File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
python/ql/src/semmle/python Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -49,12 +49,15 @@ abstract class AstNode extends AstNode_ {
49
49
/** Whether this contains `inner` syntactically */
50
50
predicate contains ( AstNode inner ) { this .getAChildNode + ( ) = inner }
51
51
52
- /** Whether this contains `inner` syntactically and `inner` has the same scope as `this` */
53
- predicate containsInScope ( AstNode inner ) {
52
+ pragma [ noinline ]
53
+ private predicate containsInScope ( AstNode inner , Scope scope ) {
54
54
this .contains ( inner ) and
55
- this . getScope ( ) = inner . getScope ( ) and
56
- not inner instanceof Scope
55
+ not inner instanceof Scope and
56
+ scope = this . getScope ( )
57
57
}
58
+
59
+ /** Whether this contains `inner` syntactically and `inner` has the same scope as `this` */
60
+ predicate containsInScope ( AstNode inner ) { this .containsInScope ( inner , inner .getScope ( ) ) }
58
61
}
59
62
60
63
/* Parents */
You can’t perform that action at this time.
0 commit comments