File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
ruby/ql/lib/codeql/ruby/ast/internal Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -486,12 +486,15 @@ private import ResolveImpl
486
486
* methods evaluate the block in the context of some other module/class instead of
487
487
* the enclosing one.
488
488
*/
489
- private ModuleBase enclosingModule ( AstNode node ) { result = parent * ( node ) .getParent ( ) }
490
-
491
- private AstNode parent ( AstNode n ) {
492
- result = n .getParent ( ) and
493
- not result instanceof ModuleBase and
494
- not result instanceof Block
489
+ private ModuleBase enclosingModule ( AstNode node ) {
490
+ result = node .getParent ( )
491
+ or
492
+ exists ( AstNode mid |
493
+ result = enclosingModule ( mid ) and
494
+ mid = node .getParent ( ) and
495
+ not mid instanceof ModuleBase and
496
+ not mid instanceof Block
497
+ )
495
498
}
496
499
497
500
private Module getAncestors ( Module m ) {
You can’t perform that action at this time.
0 commit comments