зеркало из https://github.com/github/codeql.git
C++: Add spurious dataflow test.
This commit is contained in:
Родитель
b8e6632bf1
Коммит
c389611e5c
|
@ -33,6 +33,7 @@ argHasPostUpdate
|
|||
| test.cpp:67:29:67:35 | source1 | ArgumentNode is missing PostUpdateNode. |
|
||||
| test.cpp:813:19:813:35 | * ... | ArgumentNode is missing PostUpdateNode. |
|
||||
| test.cpp:848:23:848:25 | rpx | ArgumentNode is missing PostUpdateNode. |
|
||||
| test.cpp:1057:19:1057:21 | * ... | ArgumentNode is missing PostUpdateNode. |
|
||||
postWithInFlow
|
||||
| BarrierGuard.cpp:49:6:49:6 | x [post update] | PostUpdateNode should not be the target of local flow. |
|
||||
| BarrierGuard.cpp:60:7:60:7 | x [post update] | PostUpdateNode should not be the target of local flow. |
|
||||
|
@ -168,6 +169,13 @@ postWithInFlow
|
|||
| test.cpp:1045:9:1045:11 | ref arg buf | PostUpdateNode should not be the target of local flow. |
|
||||
| test.cpp:1051:5:1051:11 | content [post update] | PostUpdateNode should not be the target of local flow. |
|
||||
| test.cpp:1052:9:1052:9 | a [inner post update] | PostUpdateNode should not be the target of local flow. |
|
||||
| test.cpp:1056:5:1056:7 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
|
||||
| test.cpp:1056:6:1056:7 | pp [inner post update] | PostUpdateNode should not be the target of local flow. |
|
||||
| test.cpp:1062:53:1062:53 | p [inner post update] | PostUpdateNode should not be the target of local flow. |
|
||||
| test.cpp:1072:3:1072:4 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
|
||||
| test.cpp:1072:4:1072:4 | p [inner post update] | PostUpdateNode should not be the target of local flow. |
|
||||
| test.cpp:1073:3:1073:4 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
|
||||
| test.cpp:1073:4:1073:4 | p [inner post update] | PostUpdateNode should not be the target of local flow. |
|
||||
viableImplInCallContextTooLarge
|
||||
uniqueParameterNodeAtPosition
|
||||
uniqueParameterNodePosition
|
||||
|
|
|
@ -310,6 +310,8 @@ irFlow
|
|||
| test.cpp:1021:18:1021:32 | *call to indirect_source | test.cpp:1027:19:1027:28 | *translated |
|
||||
| test.cpp:1021:18:1021:32 | *call to indirect_source | test.cpp:1031:19:1031:28 | *translated |
|
||||
| test.cpp:1045:14:1045:19 | call to source | test.cpp:1046:7:1046:10 | * ... |
|
||||
| test.cpp:1061:15:1061:38 | *call to indirect_source | test.cpp:1057:19:1057:21 | ** ... |
|
||||
| test.cpp:1072:8:1072:13 | call to source | test.cpp:1074:8:1074:9 | * ... |
|
||||
| true_upon_entry.cpp:9:11:9:16 | call to source | true_upon_entry.cpp:13:8:13:8 | x |
|
||||
| true_upon_entry.cpp:17:11:17:16 | call to source | true_upon_entry.cpp:21:8:21:8 | x |
|
||||
| true_upon_entry.cpp:27:9:27:14 | call to source | true_upon_entry.cpp:29:8:29:8 | x |
|
||||
|
|
|
@ -1050,4 +1050,26 @@ void flow_out_of_address_with_local_flow() {
|
|||
MyStruct a;
|
||||
a.content = nullptr;
|
||||
sink(&a); // $ SPURIOUS: ast
|
||||
}
|
||||
}
|
||||
|
||||
static void static_func_that_reassigns_pointer_before_sink(char** pp) { // $ ast-def=pp ir-def=*pp ir-def=**pp
|
||||
*pp = "";
|
||||
indirect_sink(*pp); // $ SPURIOUS: ir
|
||||
}
|
||||
|
||||
void test_static_func_that_reassigns_pointer_before_sink() {
|
||||
char* p = (char*)indirect_source();
|
||||
static_func_that_reassigns_pointer_before_sink(&p);
|
||||
}
|
||||
|
||||
void single_object_in_both_cases(bool b, int x, int y) {
|
||||
int* p;
|
||||
if(b) {
|
||||
p = &x;
|
||||
} else {
|
||||
p = &y;
|
||||
}
|
||||
*p = source();
|
||||
*p = 0;
|
||||
sink(*p); // $ SPURIOUS: ir
|
||||
}
|
||||
|
|
|
@ -15,4 +15,5 @@ incorrectBaseType
|
|||
| test.cpp:848:23:848:25 | (reference dereference) | Expected 'Node.getType()' to be int, but it was int * |
|
||||
| test.cpp:854:10:854:36 | * ... | Expected 'Node.getType()' to be const int, but it was int |
|
||||
| test.cpp:867:10:867:30 | * ... | Expected 'Node.getType()' to be const int, but it was int |
|
||||
| test.cpp:1062:52:1062:53 | *& ... | Expected 'Node.getType()' to be char, but it was char * |
|
||||
failures
|
||||
|
|
Загрузка…
Ссылка в новой задаче