mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
C++: Accept test changes.
This commit is contained in:
@@ -63,7 +63,7 @@ namespace std {
|
||||
template<class T> T&& move(T& t) noexcept; // simplified signature
|
||||
}
|
||||
|
||||
void identityOperations(int* source1) { // $ ast-def=source1
|
||||
void identityOperations(int* source1) { // $ ast-def=source1 ir-def=*source1
|
||||
const int *x1 = std::move(source1);
|
||||
int* x2 = const_cast<int*>(x1);
|
||||
int* x3 = (x2);
|
||||
@@ -484,7 +484,7 @@ struct MyStruct {
|
||||
int* content;
|
||||
};
|
||||
|
||||
void local_field_flow_def_by_ref_steps_with_local_flow(MyStruct * s) { // $ ast-def=s
|
||||
void local_field_flow_def_by_ref_steps_with_local_flow(MyStruct * s) { // $ ast-def=s ir-def=*s
|
||||
writes_to_content(s->content);
|
||||
int* p_content = s->content;
|
||||
sink(*p_content);
|
||||
@@ -521,12 +521,12 @@ void uncertain_definition() {
|
||||
sink(stackArray[0]); // $ ast=519:19 ir SPURIOUS: ast=517:7
|
||||
}
|
||||
|
||||
void set_through_const_pointer(int x, const int **e) // $ ast-def=e ir-def=**e ir-def=*e
|
||||
void set_through_const_pointer(int x, const int **e) // $ ast-def=e ir-def=*e ir-def=**e
|
||||
{
|
||||
*e = &x;
|
||||
}
|
||||
|
||||
void test_set_through_const_pointer(int *e) // $ ast-def=e
|
||||
void test_set_through_const_pointer(int *e) // $ ast-def=e ir-def=*e
|
||||
{
|
||||
set_through_const_pointer(source(), &e);
|
||||
sink(*e); // $ ir MISSING: ast
|
||||
@@ -579,7 +579,7 @@ namespace IndirectFlowThroughGlobals {
|
||||
}
|
||||
}
|
||||
|
||||
void write_to_param(int* x) { // $ ast-def=x
|
||||
void write_to_param(int* x) { // $ ast-def=x ir-def=*x
|
||||
int s = source();
|
||||
x = &s;
|
||||
}
|
||||
@@ -587,7 +587,7 @@ void write_to_param(int* x) { // $ ast-def=x
|
||||
void test_write_to_param() {
|
||||
int x = 0;
|
||||
write_to_param(&x);
|
||||
sink(x); // $ SPURIOUS: ast
|
||||
sink(x); // $ SPURIOUS: ast,ir
|
||||
}
|
||||
|
||||
void test_indirect_flow_to_array() {
|
||||
@@ -609,7 +609,7 @@ void test_def_by_ref_followed_by_uncertain_write_pointer(int* p) { // $ ast-def=
|
||||
sink(*p); // $ ir MISSING: ast
|
||||
}
|
||||
|
||||
void test_flow_through_void_double_pointer(int *p) // $ ast-def=p
|
||||
void test_flow_through_void_double_pointer(int *p) // $ ast-def=p ir-def=*p
|
||||
{
|
||||
intPointerSource(p);
|
||||
void* q = (void*)&p;
|
||||
@@ -695,11 +695,11 @@ void increment_buf(int** buf) { // $ ast-def=buf ir-def=*buf ir-def=**buf
|
||||
sink(buf); // $ SPURIOUS: ast
|
||||
}
|
||||
|
||||
void call_increment_buf(int** buf) { // $ ast-def=buf
|
||||
void call_increment_buf(int** buf) { // $ ast-def=buf ir-def=*buf ir-def=**buf
|
||||
increment_buf(buf);
|
||||
}
|
||||
|
||||
void test_conflation_regression(int* source) { // $ ast-def=source
|
||||
void test_conflation_regression(int* source) { // $ ast-def=source ir-def=*source
|
||||
int* buf = source;
|
||||
call_increment_buf(&buf);
|
||||
}
|
||||
@@ -709,13 +709,13 @@ void write_to_star_star_p(unsigned char **p) // $ ast-def=p ir-def=**p ir-def=*p
|
||||
**p = 0;
|
||||
}
|
||||
|
||||
void write_to_star_buf(unsigned char *buf) // $ ast-def=buf
|
||||
void write_to_star_buf(unsigned char *buf) // $ ast-def=buf ir-def=*buf
|
||||
{
|
||||
unsigned char *c = buf;
|
||||
write_to_star_star_p(&c);
|
||||
}
|
||||
|
||||
void test_write_to_star_buf(unsigned char *source) // $ ast-def=source
|
||||
void test_write_to_star_buf(unsigned char *source) // $ ast-def=source ir-def=*source
|
||||
{
|
||||
write_to_star_buf(source);
|
||||
sink(*source); // clean
|
||||
@@ -1041,7 +1041,7 @@ namespace test_gettext {
|
||||
|
||||
void* memset(void*, int, size_t);
|
||||
|
||||
void memset_test(char* buf) { // $ ast-def=buf
|
||||
void memset_test(char* buf) { // $ ast-def=buf ir-def=*buf
|
||||
memset(buf, source(), 10);
|
||||
sink(*buf); // $ ir MISSING: ast
|
||||
}
|
||||
Reference in New Issue
Block a user