Skip to content

Commit 0ffb0f6

Browse files
committed
Ruby: constant lookup is unaffected by blocks
1 parent 84ae17d commit 0ffb0f6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

ruby/ql/lib/codeql/ruby/ast/internal/Module.qll

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,8 @@ private module ResolveImpl {
408408
string getAnAssumedGlobalConst() {
409409
exists(ConstantAccess access |
410410
not exists(access.getScopeExpr()) and
411-
result = access.getName()
412-
|
413-
access.hasGlobalScope()
414-
or
415-
// At the top-level but not inside a block
416-
enclosingModuleNoBlock(access) instanceof Toplevel
411+
result = access.getName() and
412+
isToplevel(access)
417413
)
418414
}
419415

0 commit comments

Comments
 (0)