File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
javascript/ql/lib/semmle/javascript Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -773,7 +773,8 @@ module API {
773773 // In general, turn store steps into member steps for def-nodes
774774 exists ( string prop |
775775 PreCallGraphStep:: storeStep ( rhs , pred , prop ) and
776- lbl = Label:: member ( prop )
776+ lbl = Label:: member ( prop ) and
777+ not DataFlow:: PseudoProperties:: isPseudoProperty ( prop )
777778 )
778779 or
779780 exists ( DataFlow:: FunctionNode fn |
@@ -941,7 +942,6 @@ module API {
941942 ( base instanceof TNonModuleDef or base instanceof TUse )
942943 )
943944 or
944- // invocations
945945 exists ( DataFlow:: SourceNode src , DataFlow:: SourceNode pred |
946946 use ( base , src ) and pred = trackUseNode ( src )
947947 |
@@ -962,6 +962,13 @@ module API {
962962 or
963963 ref = cls .getAClassReference ( ) .getAnInstantiation ( )
964964 )
965+ or
966+ exists ( string prop |
967+ PreCallGraphStep:: loadStep ( pred .getALocalUse ( ) , ref , prop ) and
968+ lbl = Label:: member ( prop ) and
969+ // avoid generating member edges like "$arrayElement$"
970+ not DataFlow:: PseudoProperties:: isPseudoProperty ( prop )
971+ )
965972 )
966973 or
967974 exists ( DataFlow:: Node def , DataFlow:: FunctionNode fn |
Original file line number Diff line number Diff line change @@ -704,6 +704,10 @@ module SharedFlowStep {
704704 * For use with load/store steps in `DataFlow::SharedFlowStep` and TypeTracking.
705705 */
706706module PseudoProperties {
707+ /** Holds if `s` is a pseudo-property. */
708+ bindingset [ s]
709+ predicate isPseudoProperty ( string s ) { s .matches ( "$%$" ) }
710+
707711 bindingset [ s]
708712 private string pseudoProperty ( string s ) { result = "$" + s + "$" }
709713
You can’t perform that action at this time.
0 commit comments