@@ -16,7 +16,6 @@ import codeql.ruby.ast.internal.Constant
16
16
import codeql.ruby.Concepts
17
17
import codeql.ruby.frameworks.ActiveRecord
18
18
private import codeql.ruby.TaintTracking
19
- private import codeql.ruby.CFG
20
19
private import codeql.ruby.controlflow.internal.Guards as Guards
21
20
22
21
/** Gets the name of a built-in method that involves a loop operation. */
@@ -42,7 +41,7 @@ class LoopingCall extends DataFlow::CallNode {
42
41
43
42
/** Holds if `ar` influences a guard that may control the execution of a loop. */
44
43
predicate usedInLoopControlGuard ( ActiveRecordInstance ar ) {
45
- exists ( DataFlow:: Node insideGuard , CfgNodes:: ExprCfgNode guard |
44
+ exists ( DataFlow:: Node insideGuard , Cfg :: CfgNodes:: ExprCfgNode guard |
46
45
// For a guard like `cond && ar`, the whole guard will not be tainted
47
46
// so we need to look at the taint of the individual parts.
48
47
insideGuard .asExpr ( ) .getExpr ( ) = guard .getExpr ( ) .getAChild * ( )
@@ -53,12 +52,12 @@ predicate usedInLoopControlGuard(ActiveRecordInstance ar) {
53
52
}
54
53
55
54
/** Holds if `guard` controls `break` and `break` would break out of a loop. */
56
- predicate guardForLoopControl ( CfgNodes:: ExprCfgNode guard , CfgNodes:: AstCfgNode break ) {
55
+ predicate guardForLoopControl ( Cfg :: CfgNodes:: ExprCfgNode guard , Cfg :: CfgNodes:: AstCfgNode break ) {
57
56
Guards:: guardControlsBlock ( guard , break .getBasicBlock ( ) , _) and
58
57
(
59
- break .( CfgNodes:: ExprNodes:: MethodCallCfgNode ) .getMethodName ( ) = "raise"
58
+ break .( Cfg :: CfgNodes:: ExprNodes:: MethodCallCfgNode ) .getMethodName ( ) = "raise"
60
59
or
61
- break instanceof CfgNodes:: ReturningCfgNode
60
+ break instanceof Cfg :: CfgNodes:: ReturningCfgNode
62
61
)
63
62
}
64
63
0 commit comments