Skip to content

Commit 60ee92d

Browse files
committed
C++: Drive-by fix: Don't use the uncached ''getAPhiInputOrPriorDefinition' predicate. Instead, cache it and call it like we are supposed to.
1 parent d89967c commit 60ee92d

File tree

1 file changed

+6
-1
lines changed
  • cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal

1 file changed

+6
-1
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaImpl.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,11 @@ module SsaCached {
940940
SsaImpl::phiHasInputFromBlock(phi, inp, bb)
941941
}
942942

943+
cached
944+
predicate uncertainWriteDefinitionInput(Definition uncertain, Definition inp) {
945+
SsaImpl::uncertainWriteDefinitionInput(uncertain, inp)
946+
}
947+
943948
cached
944949
predicate ssaDefReachesEndOfBlock(IRBlock bb, Definition def) {
945950
SsaImpl::ssaDefReachesEndOfBlock(bb, def, _)
@@ -1178,7 +1183,7 @@ class Definition extends SsaImpl::Definition {
11781183
private Definition getAPhiInputOrPriorDefinition() {
11791184
result = this.(PhiNode).getAnInput()
11801185
or
1181-
SsaImpl::uncertainWriteDefinitionInput(this, result)
1186+
uncertainWriteDefinitionInput(this, result)
11821187
}
11831188

11841189
/**

0 commit comments

Comments
 (0)