File tree 1 file changed +7
-2
lines changed
ruby/ql/src/queries/variables
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11
11
*/
12
12
13
13
import codeql.ruby.AST
14
+ import codeql.ruby.CFG
14
15
import codeql.ruby.dataflow.SSA
15
16
import codeql.ruby.ApiGraphs
16
17
18
+ pragma [ nomagic]
19
+ private predicate hasErbResultCall ( CfgScope scope ) {
20
+ scope = API:: getTopLevelMember ( "ERB" ) .getInstance ( ) .getAMethodCall ( "result" ) .asExpr ( ) .getScope ( )
21
+ }
22
+
17
23
class RelevantLocalVariableWriteAccess extends LocalVariableWriteAccess {
18
24
RelevantLocalVariableWriteAccess ( ) {
19
25
not this .getVariable ( ) .getName ( ) .charAt ( 0 ) = "_" and
20
26
not this = any ( Parameter p ) .getAVariable ( ) .getDefiningAccess ( ) and
21
- not API:: getTopLevelMember ( "ERB" ) .getInstance ( ) .getAMethodCall ( "result" ) .asExpr ( ) .getScope ( ) =
22
- this .getCfgScope ( ) and
27
+ not hasErbResultCall ( this .getCfgScope ( ) ) and
23
28
not exists ( RetryStmt r | r .getCfgScope ( ) = this .getCfgScope ( ) ) and
24
29
not exists ( MethodCall c |
25
30
c .getReceiver ( ) instanceof SelfVariableAccess and
You can’t perform that action at this time.
0 commit comments