mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
C++: Add testcase with missing MaD support for resolving typedefs inside arrays.
This commit is contained in:
@@ -230,3 +230,10 @@ sourceCallables
|
||||
| tests.cpp:463:6:463:6 | x |
|
||||
| tests.cpp:464:36:464:36 | s |
|
||||
| tests.cpp:465:6:465:6 | y |
|
||||
| tests.cpp:469:7:469:9 | INT |
|
||||
| tests.cpp:471:5:471:17 | receive_array |
|
||||
| tests.cpp:471:23:471:23 | a |
|
||||
| tests.cpp:473:6:473:23 | test_receive_array |
|
||||
| tests.cpp:474:6:474:6 | x |
|
||||
| tests.cpp:475:6:475:10 | array |
|
||||
| tests.cpp:476:6:476:6 | y |
|
||||
|
||||
@@ -98,7 +98,8 @@ private class TestSummaries extends SummaryModelCsv {
|
||||
";;false;madCallArg0ReturnToReturnFirst;;;Argument[0].ReturnValue;ReturnValue.Field[first];value",
|
||||
";;false;madCallArg0WithValue;;;Argument[1];Argument[0].Parameter[0];value",
|
||||
";;false;madCallReturnValueIgnoreFunction;;;Argument[1];ReturnValue;value",
|
||||
";StructWithTypedefInParameter<T>;true;parameter_ref_to_return_ref;(const T &);;Argument[*0];ReturnValue[*];value"
|
||||
";StructWithTypedefInParameter<T>;true;parameter_ref_to_return_ref;(const T &);;Argument[*0];ReturnValue[*];value",
|
||||
";;false;receive_array;(int[20]);;Argument[*0];ReturnValue;taint"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,4 +464,15 @@ void test_parameter_ref_to_return_ref() {
|
||||
StructWithTypedefInParameter<int> s;
|
||||
int y = s.parameter_ref_to_return_ref(x);
|
||||
sink(y); // $ ir
|
||||
}
|
||||
|
||||
using INT = int;
|
||||
|
||||
int receive_array(INT a[20]); // $ MISSING: interpretElement
|
||||
|
||||
void test_receive_array() {
|
||||
int x = source();
|
||||
int array[10] = {x};
|
||||
int y = receive_array(array);
|
||||
sink(y); // $ MISSING: ir
|
||||
}
|
||||
Reference in New Issue
Block a user