@@ -663,7 +663,14 @@ module API {
663663 or
664664 any ( Type t ) .hasUnderlyingType ( m , _)
665665 } or
666- MkClassInstance ( DataFlow:: ClassNode cls ) { cls = trackDefNode ( _) and hasSemantics ( cls ) } or
666+ MkClassInstance ( DataFlow:: ClassNode cls ) {
667+ hasSemantics ( cls ) and
668+ (
669+ cls = trackDefNode ( _)
670+ or
671+ cls .getAnInstanceReference ( ) = trackDefNode ( _)
672+ )
673+ } or
667674 MkAsyncFuncResult ( DataFlow:: FunctionNode f ) {
668675 f = trackDefNode ( _) and f .getFunction ( ) .isAsync ( ) and hasSemantics ( f )
669676 } or
@@ -755,16 +762,6 @@ module API {
755762 .getStaticMember ( name , DataFlow:: MemberKind:: getter ( ) )
756763 .getAReturn ( )
757764 )
758- or
759- // If `new C()` escapes, generate edges to its instance members
760- exists ( DataFlow:: ClassNode cls , string name |
761- pred = cls .getAClassReference ( ) .getAnInstantiation ( ) and
762- lbl = Label:: member ( name )
763- |
764- rhs = cls .getInstanceMethod ( name )
765- or
766- rhs = cls .getInstanceMember ( name , DataFlow:: MemberKind:: getter ( ) ) .getAReturn ( )
767- )
768765 )
769766 or
770767 exists ( DataFlow:: ClassNode cls , string name |
@@ -1253,9 +1250,13 @@ module API {
12531250 succ = MkUse ( ref )
12541251 )
12551252 or
1256- exists ( DataFlow:: Node rhs |
1257- rhs ( pred , lbl , rhs ) and
1253+ exists ( DataFlow:: Node rhs | rhs ( pred , lbl , rhs ) |
12581254 succ = MkDef ( rhs )
1255+ or
1256+ exists ( DataFlow:: ClassNode cls |
1257+ cls .getAnInstanceReference ( ) = rhs and
1258+ succ = MkClassInstance ( cls )
1259+ )
12591260 )
12601261 or
12611262 exists ( DataFlow:: Node def |
0 commit comments