mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
CPP: Add dataflow FP with output arguments
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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); // $ ir
|
||||
}
|
||||
Reference in New Issue
Block a user