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_ {
4949 /** Whether this contains `inner` syntactically */
5050 predicate contains ( AstNode inner ) { this .getAChildNode + ( ) = inner }
5151
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 ) {
5454 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 ( )
5757 }
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 ( ) ) }
5861}
5962
6063/* Parents */
You can’t perform that action at this time.
0 commit comments