mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
Ruby: constant lookup is unaffected by blocks
This commit is contained in:
@@ -408,12 +408,8 @@ private module ResolveImpl {
|
||||
string getAnAssumedGlobalConst() {
|
||||
exists(ConstantAccess access |
|
||||
not exists(access.getScopeExpr()) and
|
||||
result = access.getName()
|
||||
|
|
||||
access.hasGlobalScope()
|
||||
or
|
||||
// At the top-level but not inside a block
|
||||
enclosingModuleNoBlock(access) instanceof Toplevel
|
||||
result = access.getName() and
|
||||
isToplevel(access)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user