Use basicLocalFlowStep instead of .getASuccessor

This prevents non-monotonic recursion through summary post-update nodes
This commit is contained in:
Sauyon Lee
2021-10-08 02:31:27 -07:00
committed by Owen Mansel-Chan
parent afe7edc093
commit 873f496038
2 changed files with 5 additions and 3 deletions

View File

@@ -15,7 +15,9 @@ private predicate isInterfaceCallReceiver(
/** Gets a data-flow node that may flow into the receiver value of `call`, which is an interface value. */
private DataFlow::Node getInterfaceCallReceiverSource(DataFlow::CallNode call) {
isInterfaceCallReceiver(call, result.getASuccessor*(), _, _)
exists(DataFlow::Node succ | basicLocalFlowStep*(result, succ) |
isInterfaceCallReceiver(call, succ, _, _)
)
}
/** Gets the type of `nd`, which must be a valid type and not an interface type. */
@@ -37,7 +39,7 @@ private predicate isConcreteValue(DataFlow::Node nd) {
(
exists(getConcreteType(nd))
or
forex(DataFlow::Node pred | pred = nd.getAPredecessor() | isConcreteValue(pred))
forex(DataFlow::Node pred | basicLocalFlowStep(pred, nd) | isConcreteValue(pred))
)
}

View File

@@ -428,7 +428,7 @@ module Public {
*/
private DataFlow::Node getACalleeSource(DataFlow::CallNode cn) {
result = cn.getCalleeNode() or
result.getASuccessor() = getACalleeSource(cn)
basicLocalFlowStep(result, getACalleeSource(cn))
}
/** A data flow node that represents a call. */