Files
codeql/cpp/ql/test/library-tests/dataflow/dataflow-tests/flowOut.cpp
Alexander Eyers-Taylor b8d45ae927 Update cpp/ql/test/library-tests/dataflow/dataflow-tests/flowOut.cpp
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2023-10-30 14:04:45 +00:00

20 lines
329 B
C++

int source();
void sink(int);
void source_ref(int *toTaint) { // $ ir-def=*toTaint ast-def=toTaint
*toTaint = source();
}
void modify_copy(int* ptr) { // $ ast-def=ptr
int deref = *ptr;
int* other = &deref;
source_ref(other);
}
void test_output() {
int x = 0;
modify_copy(&x);
sink(x); // $ SPURIOUS: ir
}