mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
C++: Add another testcase with spurious summary flow.
This commit is contained in:
@@ -20,6 +20,7 @@ reverseRead
|
||||
argHasPostUpdate
|
||||
postWithInFlow
|
||||
| flowOut.cpp:84:3:84:14 | *access to array | PostUpdateNode should not be the target of local flow. |
|
||||
| flowOut.cpp:111:28:111:31 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
|
||||
| test.cpp:384:10:384:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
|
||||
| test.cpp:391:10:391:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
|
||||
| test.cpp:400:10:400:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
|
||||
|
||||
@@ -101,3 +101,18 @@ void test2() {
|
||||
addtaint2(&p);
|
||||
sink(*p); // $ ir MISSING: ast
|
||||
}
|
||||
|
||||
using size_t = decltype(sizeof(int));
|
||||
|
||||
void* memcpy(void* dest, const void* src, size_t);
|
||||
|
||||
void modify_copy_via_memcpy(char* p) { // $ ast-def=p
|
||||
char* dest;
|
||||
char* p2 = (char*)memcpy(dest, p, 10);
|
||||
source_ref(p2);
|
||||
}
|
||||
|
||||
void test_modify_copy_via_memcpy(char* p) { // $ ast-def=p
|
||||
modify_copy_via_memcpy(p);
|
||||
sink(*p); // $ SPURIOUS: ir
|
||||
}
|
||||
@@ -175,6 +175,7 @@ irFlow
|
||||
| flowOut.cpp:5:16:5:21 | call to source | flowOut.cpp:31:9:31:9 | x |
|
||||
| flowOut.cpp:5:16:5:21 | call to source | flowOut.cpp:61:8:61:11 | access to array |
|
||||
| flowOut.cpp:8:16:8:23 | call to source | flowOut.cpp:73:8:73:9 | * ... |
|
||||
| flowOut.cpp:8:16:8:23 | call to source | flowOut.cpp:117:8:117:9 | * ... |
|
||||
| flowOut.cpp:84:18:84:23 | call to source | flowOut.cpp:85:8:85:9 | * ... |
|
||||
| flowOut.cpp:90:8:90:13 | call to source | flowOut.cpp:102:8:102:9 | * ... |
|
||||
| globals.cpp:5:17:5:22 | call to source | globals.cpp:6:10:6:14 | local |
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
| flowOut.cpp:44:7:44:7 | x | flowOut.cpp:46:8:46:8 | x |
|
||||
| flowOut.cpp:59:7:59:7 | x | flowOut.cpp:60:18:60:18 | x |
|
||||
| flowOut.cpp:59:7:59:7 | x | flowOut.cpp:61:8:61:8 | x |
|
||||
| flowOut.cpp:110:9:110:12 | dest | flowOut.cpp:111:28:111:31 | dest |
|
||||
| ref.cpp:53:9:53:10 | x1 | ref.cpp:55:19:55:20 | x1 |
|
||||
| ref.cpp:53:9:53:10 | x1 | ref.cpp:56:10:56:11 | x1 |
|
||||
| ref.cpp:53:13:53:14 | x2 | ref.cpp:58:15:58:16 | x2 |
|
||||
|
||||
Reference in New Issue
Block a user