Skip to content

Commit 2fd07f2

Browse files
committed
C++: Add test with missing flow.
1 parent 197642c commit 2fd07f2

File tree

1 file changed

+17
-1
lines changed
  • cpp/ql/test/library-tests/dataflow/fields

1 file changed

+17
-1
lines changed

cpp/ql/test/library-tests/dataflow/fields/simple.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,20 @@ void post_update_to_phi_input(bool b)
120120
sink(a.i); // $ ast,ir
121121
}
122122

123-
} // namespace Simple
123+
void write_to_param(int* p) {
124+
*p = user_input();
125+
}
126+
127+
void alias_with_fields(bool b) {
128+
A a;
129+
int* q;
130+
if(b) {
131+
q = &a.i;
132+
} else {
133+
q = nullptr;
134+
}
135+
write_to_param(q);
136+
sink(a.i); // $ MISSING: ast,ir
137+
}
138+
139+
} // namespace Simple

0 commit comments

Comments
 (0)