Skip to content

Commit 5816f17

Browse files
committed
C++: Add failing test.
1 parent b3a19ef commit 5816f17

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

cpp/ql/test/library-tests/dataflow/dataflow-tests/dataflow-consistency.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ postWithInFlow
128128
| test.cpp:690:3:690:3 | s [post update] | PostUpdateNode should not be the target of local flow. |
129129
| test.cpp:694:4:694:6 | buf [inner post update] | PostUpdateNode should not be the target of local flow. |
130130
| test.cpp:704:23:704:25 | buf [inner post update] | PostUpdateNode should not be the target of local flow. |
131+
| test.cpp:715:25:715:25 | c [inner post update] | PostUpdateNode should not be the target of local flow. |
131132
viableImplInCallContextTooLarge
132133
uniqueParameterNodeAtPosition
133134
uniqueParameterNodePosition

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,4 +702,21 @@ void call_increment_buf(int** buf) { // $ ast-def=buf
702702
void test_conflation_regression(int* source) { // $ ast-def=source
703703
int* buf = source;
704704
call_increment_buf(&buf);
705+
}
706+
707+
void write_to_star_star_p(unsigned char **p) // $ ast-def=p ir-def=**p ir-def=*p
708+
{
709+
**p = 0;
710+
}
711+
712+
void write_to_star_buf(unsigned char *buf) // $ ast-def=buf
713+
{
714+
unsigned char *c = buf;
715+
write_to_star_star_p(&c);
716+
}
717+
718+
void test(unsigned char *source) // $ ast-def=source
719+
{
720+
write_to_star_buf(source);
721+
sink(*source); // $ SPURIOUS: ir
705722
}

0 commit comments

Comments
 (0)