Skip to content

Commit 2458fa0

Browse files
committed
C++: Push conjunct into 'isSuccessor' and rename it to 'fwdIsSuccessor'.
1 parent 594da1a commit 2458fa0

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

cpp/ql/lib/experimental/semmle/code/cpp/dataflow/ProductFlow.qll

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,7 @@ module ProductFlow {
337337
private predicate fwdReachableInterprocEntry(Flow1::PathNode node1, Flow2::PathNode node2) {
338338
isSourcePair(node1, node2)
339339
or
340-
exists(Flow1::PathNode pred1, Flow2::PathNode pred2 |
341-
fwdReachableInterprocEntry(pred1, pred2) and
342-
isSuccessor(pred1, pred2, node1, node2)
343-
)
340+
fwdIsSuccessor(_, _, node1, node2)
344341
}
345342

346343
pragma[assume_small_delta]
@@ -424,11 +421,10 @@ module ProductFlow {
424421
localPathStep2SuccPlus(n1, n2) or n1 = n2
425422
}
426423

427-
bindingset[pred1, pred2]
428-
bindingset[succ1, succ2]
429-
private predicate isSuccessor(
424+
private predicate fwdIsSuccessor(
430425
Flow1::PathNode pred1, Flow2::PathNode pred2, Flow1::PathNode succ1, Flow2::PathNode succ2
431426
) {
427+
fwdReachableInterprocEntry(pred1, pred2) and
432428
exists(Flow1::PathNode mid1, Flow2::PathNode mid2 |
433429
localPathStep1Tc(pred1, mid1) and
434430
localPathStep2Tc(pred2, mid2)
@@ -445,13 +441,11 @@ module ProductFlow {
445441
pragma[nomagic]
446442
private predicate revReachableInterprocEntry(Flow1::PathNode node1, Flow2::PathNode node2) {
447443
fwdReachableInterprocEntry(node1, node2) and
448-
(
449-
isSinkPair(node1, node2)
450-
or
451-
exists(Flow1::PathNode succ1, Flow2::PathNode succ2 |
452-
revReachableInterprocEntry(succ1, succ2) and
453-
isSuccessor(node1, node2, succ1, succ2)
454-
)
444+
isSinkPair(node1, node2)
445+
or
446+
exists(Flow1::PathNode succ1, Flow2::PathNode succ2 |
447+
revReachableInterprocEntry(succ1, succ2) and
448+
fwdIsSuccessor(node1, node2, succ1, succ2)
455449
)
456450
}
457451

@@ -464,7 +458,7 @@ module ProductFlow {
464458
exists(Flow1::PathNode n11, Flow2::PathNode n12, Flow1::PathNode n21, Flow2::PathNode n22 |
465459
n1 = TMkNodePair(n11, n12) and
466460
n2 = TMkNodePair(n21, n22) and
467-
isSuccessor(n11, n12, n21, n22)
461+
fwdIsSuccessor(n11, n12, n21, n22)
468462
)
469463
}
470464

0 commit comments

Comments
 (0)