mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
19 lines
363 B
C++
19 lines
363 B
C++
int source();
|
|
void gard_condition_sink(int);
|
|
void use(int);
|
|
/*
|
|
This test checks that we hit the node corresponding to the expression node that wraps `source`
|
|
in the condition `source >= 0`.
|
|
*/
|
|
void test_guard_condition(int source, bool b)
|
|
{
|
|
if (b) {
|
|
use(source);
|
|
}
|
|
|
|
if (source >= 0) {
|
|
use(source);
|
|
}
|
|
|
|
gard_condition_sink(source); // clean
|
|
} |