Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 575ac46

Browse files
committed
C++: Add failing test.
1 parent b952f61 commit 575ac46

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ postWithInFlow
110110
| test.cpp:589:19:589:19 | x [inner post update] | PostUpdateNode should not be the target of local flow. |
111111
| test.cpp:596:3:596:4 | xs [inner post update] | PostUpdateNode should not be the target of local flow. |
112112
| test.cpp:596:3:596:7 | access to array [post update] | PostUpdateNode should not be the target of local flow. |
113+
| test.cpp:602:3:602:3 | p [inner post update] | PostUpdateNode should not be the target of local flow. |
114+
| test.cpp:602:3:602:7 | access to array [post update] | PostUpdateNode should not be the target of local flow. |
115+
| test.cpp:608:3:608:4 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
116+
| test.cpp:608:4:608:4 | p [inner post update] | PostUpdateNode should not be the target of local flow. |
113117
viableImplInCallContextTooLarge
114118
uniqueParameterNodeAtPosition
115119
uniqueParameterNodePosition

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,3 +596,15 @@ void test_indirect_flow_to_array() {
596596
xs[0] = p;
597597
sink(*xs[0]); // $ ir=594:12 MISSING: ast SPURIOUS: ir=595:8
598598
}
599+
600+
void test_def_by_ref_followed_by_uncertain_write_array(int* p) { // $ ast-def=p ir-def=*p
601+
intPointerSource(p);
602+
p[10] = 0;
603+
sink(*p); // $ MISSING: ast,ir
604+
}
605+
606+
void test_def_by_ref_followed_by_uncertain_write_pointer(int* p) { // $ ast-def=p ir-def=*p
607+
intPointerSource(p);
608+
*p = 0;
609+
sink(*p); // $ MISSING: ast,ir
610+
}

0 commit comments

Comments
 (0)