Skip to content

Commit 6eeb711

Browse files
committed
Ruby: Add AdditionalJumpStep class
1 parent a5bb336 commit 6eeb711

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,8 @@ predicate jumpStep(Node pred, Node succ) {
11571157
succ.asExpr().getExpr().(ConstantReadAccess).getValue() = pred.asExpr().getExpr()
11581158
or
11591159
FlowSummaryImpl::Private::Steps::summaryJumpStep(pred, succ)
1160+
or
1161+
any(AdditionalJumpStep s).step(pred, succ)
11601162
}
11611163

11621164
private ContentSet getKeywordContent(string name) {
@@ -1484,3 +1486,15 @@ ContentApprox getContentApprox(Content c) {
14841486
or
14851487
result = TNonElementContentApprox(c)
14861488
}
1489+
1490+
/**
1491+
* A unit class for adding additional jump steps.
1492+
*
1493+
* Extend this class to add additional jump steps.
1494+
*/
1495+
class AdditionalJumpStep extends Unit {
1496+
/**
1497+
* Holds if data can flow from `pred` to `succ` in a way that discards call contexts.
1498+
*/
1499+
abstract predicate step(Node pred, Node succ);
1500+
}

0 commit comments

Comments
 (0)