C++: Modify IR field flow tests to use InlineExpectationsTest.qll

This commit is contained in:
Mathias Vorreiter Pedersen
2020-05-14 11:11:21 +02:00
parent 34314d0cb6
commit f5f3405ec3
16 changed files with 126 additions and 1039 deletions

View File

@@ -25,8 +25,8 @@ public:
void bar(Foo &f)
{
sink(f.a()); // flow (through `f.setA` and `h.setA`)
sink(f.b()); // flow (through `g.setB` and `h.setB`)
sink(f.a()); //$ast=flow 39:12 $ast=flow 41:12 $f-:ir=flow
sink(f.b()); //$ast=flow 40:12 $ast=flow 42:12 $f-:ir=flow
}
void foo()
@@ -64,7 +64,7 @@ void single_field_test()
A a;
a.i = user_input();
A a2 = a;
sink(a2.i); // flow
sink(a2.i); //$ast,ir=flow
}
struct C {
@@ -81,7 +81,7 @@ struct C2
void m() {
f2.f1 = user_input();
sink(getf2f1()); // flow [NOT DETECTED by IR]
sink(getf2f1()); //$ast=flow $f-:ir=flow
}
};