File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
ruby/ql/lib/codeql/ruby/ast Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ class LocalVariable extends Variable, TLocalVariable {
51
51
*
52
52
* `x` is a captured variable, whereas `y` is not.
53
53
*/
54
- predicate isCaptured ( ) { this .getAnAccess ( ) .isCapturedAccess ( ) }
54
+ final predicate isCaptured ( ) { this .getAnAccess ( ) .isCapturedAccess ( ) }
55
55
}
56
56
57
57
/** A global variable. */
@@ -152,7 +152,7 @@ class LocalVariableAccess extends VariableAccess instanceof LocalVariableAccessI
152
152
* the access to `x` in the first `puts x` is a captured access, while
153
153
* the access to `x` in the second `puts x` is not.
154
154
*/
155
- predicate isCapturedAccess ( ) { isCapturedAccess ( this ) }
155
+ final predicate isCapturedAccess ( ) { isCapturedAccess ( this ) }
156
156
}
157
157
158
158
/** An access to a local variable where the value is updated. */
@@ -200,10 +200,4 @@ class SelfVariableAccess extends LocalVariableAccess instanceof SelfVariableAcce
200
200
}
201
201
202
202
/** An access to the `self` variable where the value is read. */
203
- class SelfVariableReadAccess extends SelfVariableAccess , VariableReadAccess {
204
- // We override the definition in `LocalVariableAccess` because it gives the
205
- // wrong result for synthesised `self` variables.
206
- override predicate isCapturedAccess ( ) {
207
- this .getVariable ( ) .getDeclaringScope ( ) != this .getCfgScope ( )
208
- }
209
- }
203
+ class SelfVariableReadAccess extends SelfVariableAccess , VariableReadAccess { }
You can’t perform that action at this time.
0 commit comments