Ruby: Add AdditionalJumpStep class

This commit is contained in:
Harry Maclean
2022-12-20 17:33:34 +13:00
parent a5bb336647
commit 6eeb711988

View File

@@ -1157,6 +1157,8 @@ predicate jumpStep(Node pred, Node succ) {
succ.asExpr().getExpr().(ConstantReadAccess).getValue() = pred.asExpr().getExpr()
or
FlowSummaryImpl::Private::Steps::summaryJumpStep(pred, succ)
or
any(AdditionalJumpStep s).step(pred, succ)
}
private ContentSet getKeywordContent(string name) {
@@ -1484,3 +1486,15 @@ ContentApprox getContentApprox(Content c) {
or
result = TNonElementContentApprox(c)
}
/**
* A unit class for adding additional jump steps.
*
* Extend this class to add additional jump steps.
*/
class AdditionalJumpStep extends Unit {
/**
* Holds if data can flow from `pred` to `succ` in a way that discards call contexts.
*/
abstract predicate step(Node pred, Node succ);
}