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

Skip to content

Commit 2999243

Browse files
committed
C++: Add failing IR dataflow testcase.
1 parent 9e7b73a commit 2999243

3 files changed

Lines changed: 15 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
@@ -92,6 +92,10 @@ postWithInFlow
9292
| test.cpp:506:3:506:4 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
9393
| test.cpp:506:4:506:4 | p [inner post update] | PostUpdateNode should not be the target of local flow. |
9494
| test.cpp:512:35:512:35 | x [inner post update] | PostUpdateNode should not be the target of local flow. |
95+
| test.cpp:519:3:519:12 | stackArray [inner post update] | PostUpdateNode should not be the target of local flow. |
96+
| test.cpp:519:3:519:15 | access to array [post update] | PostUpdateNode should not be the target of local flow. |
97+
| test.cpp:520:3:520:12 | stackArray [inner post update] | PostUpdateNode should not be the target of local flow. |
98+
| test.cpp:520:3:520:15 | access to array [post update] | PostUpdateNode should not be the target of local flow. |
9599
viableImplInCallContextTooLarge
96100
uniqueParameterNodeAtPosition
97101
uniqueParameterNodePosition

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,3 +512,11 @@ void viaOutparamMissingReturn() {
512512
intOutparamSourceMissingReturn(&x);
513513
sink(x); // $ ast MISSING: ir
514514
}
515+
516+
void uncertain_definition() {
517+
int stackArray[2];
518+
int clean = 0;
519+
stackArray[0] = source();
520+
stackArray[1] = clean;
521+
sink(stackArray[0]); // $ ast=519:19 SPURIOUS: ast=517:7 MISSING: ir
522+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@
3434
| test.cpp:448:7:448:11 | local | test.cpp:449:18:449:22 | local |
3535
| test.cpp:448:7:448:11 | local | test.cpp:450:8:450:12 | local |
3636
| test.cpp:448:7:448:11 | local | test.cpp:451:9:451:13 | local |
37+
| test.cpp:517:7:517:16 | stackArray | test.cpp:519:3:519:12 | stackArray |
38+
| test.cpp:517:7:517:16 | stackArray | test.cpp:520:3:520:12 | stackArray |
39+
| test.cpp:517:7:517:16 | stackArray | test.cpp:521:8:521:17 | stackArray |

0 commit comments

Comments
 (0)