Ruby: Fix another bug in isCapturedAccess

This commit is contained in:
Tom Hvitved
2023-08-10 14:02:58 +02:00
parent f377d25c23
commit f19232f800
3 changed files with 2 additions and 36 deletions

View File

@@ -368,20 +368,8 @@ private module Cached {
exists(Scope scope1, CfgScope scope2 |
scope1 = access.getVariable().getDeclaringScope() and
scope2 = access.getCfgScope() and
scope1 != scope2
|
if access instanceof SelfVariableAccess
then
// ```
// class C
// def self.m // not a captured access
// end
//
// self.foo // not a captured access
// end
// ```
not scope2 instanceof Toplevel
else any()
scope1 != scope2 and
not scope2 instanceof Toplevel
)
}