File tree Expand file tree Collapse file tree
lib/semmle/code/cpp/ir/dataflow/internal
test/library-tests/dataflow/certain Expand file tree Collapse file tree Original file line number Diff line number Diff 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. */
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments