mirror of
https://github.com/github/codeql.git
synced 2025-12-23 04:06:37 +01:00
20 lines
329 B
C++
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
|
|
} |