File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
ruby/ql/src/queries/variables Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1111 */
1212
1313import codeql.ruby.AST
14+ import codeql.ruby.CFG
1415import codeql.ruby.dataflow.SSA
1516import codeql.ruby.ApiGraphs
1617
18+ pragma [ nomagic]
19+ private predicate hasErbResultCall ( CfgScope scope ) {
20+ scope = API:: getTopLevelMember ( "ERB" ) .getInstance ( ) .getAMethodCall ( "result" ) .asExpr ( ) .getScope ( )
21+ }
22+
1723class RelevantLocalVariableWriteAccess extends LocalVariableWriteAccess {
1824 RelevantLocalVariableWriteAccess ( ) {
1925 not this .getVariable ( ) .getName ( ) .charAt ( 0 ) = "_" and
2026 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
2328 not exists ( RetryStmt r | r .getCfgScope ( ) = this .getCfgScope ( ) ) and
2429 not exists ( MethodCall c |
2530 c .getReceiver ( ) instanceof SelfVariableAccess and
You can’t perform that action at this time.
0 commit comments