Skip to content

Commit 4ec62b0

Browse files
committed
C++: Add missing overrides.
1 parent 760f803 commit 4ec62b0

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

  • cpp/ql

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,16 @@ class PhiNode extends Definition instanceof SsaImpl::PhiNode {
13571357
final predicate hasInputFromBlock(Definition input, IRBlock bb) {
13581358
phiHasInputFromBlock(this, input, bb)
13591359
}
1360+
1361+
override int getIndirection() { result = this.getSourceVariable().getIndirection() }
1362+
1363+
override predicate isCertain() {
1364+
forex(Definition inp | inp = this.getAnInput() | inp.isCertain())
1365+
}
1366+
1367+
final override Declaration getFunction() {
1368+
result = SsaImpl::PhiNode.super.getBasicBlock().getEnclosingFunction()
1369+
}
13601370
}
13611371

13621372
/** An static single assignment (SSA) definition. */

cpp/ql/test/library-tests/dataflow/certain/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void test2(bool b) { // $ certain="SSA def(&b)" certain="SSA def(b)"
2828
} else {
2929
x = 1; // $ certain="SSA def(x)"
3030
}
31-
use(x); // $ uncertain="SSA phi(x)"
31+
use(x); // $ certain="SSA phi(x)"
3232
}
3333

3434
{
@@ -38,7 +38,7 @@ void test2(bool b) { // $ certain="SSA def(&b)" certain="SSA def(b)"
3838
} else {
3939

4040
}
41-
use(x); // $ uncertain="SSA phi(x)"
41+
use(x); // $ certain="SSA phi(x)"
4242
}
4343

4444
{

0 commit comments

Comments
 (0)