Ruby: Add getBlock and getNumberOfArguments predicates to DataFlow::CallNode

This commit is contained in:
Alex Ford
2021-12-14 12:58:15 +00:00
parent 37d76f5e49
commit f3dcccb64b
3 changed files with 6 additions and 4 deletions

View File

@@ -61,6 +61,12 @@ class CallNode extends LocalSourceNode {
/** Gets the name of the the method called by the method call (if any) corresponding to this data-flow node */
string getMethodName() { result = node.getExpr().(MethodCall).getMethodName() }
/** Gets the number of arguments of this call. */
int getNumberOfArguments() { result = node.getNumberOfArguments() }
/** Gets the block of this call. */
Node getBlock() { result.asExpr() = node.getBlock() }
}
/**

View File

@@ -84,8 +84,6 @@ private class CallAgainstConfig extends DataFlow::CallNode {
CallAgainstConfig() { this.getReceiver() instanceof ConfigNode }
MethodCall getCall() { result = this.asExpr().getExpr() }
Block getBlock() { result = this.getCall().getBlock() }
}
private class ActionControllerConfigNode extends DataFlow::Node {

View File

@@ -26,8 +26,6 @@ class KernelMethodCall extends DataFlow::CallNode {
)
)
}
int getNumberOfArguments() { result = methodCall.getNumberOfArguments() }
}
/**