mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Merge pull request #12146 from jketema/global-indirect
C++: Do not mark global indirect flow as spurious in dataflow tests
This commit is contained in:
@@ -563,18 +563,18 @@ namespace IndirectFlowThroughGlobals {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void f() {
|
void f() {
|
||||||
sink(*globalInt); // $ ir=562:17 ir=576:17 // tainted or clean? Not sure.
|
sink(*globalInt); // $ ir=562:17 ir=576:17 MISSING: ast=562:17 ast=576:17
|
||||||
taintGlobal();
|
taintGlobal();
|
||||||
sink(*globalInt); // $ ir=562:17 MISSING: ast=562:17 SPURIOUS: ir=576:17
|
sink(*globalInt); // $ ir=562:17 ir=576:17 MISSING: ast=562:17 ast=576:17
|
||||||
}
|
}
|
||||||
|
|
||||||
void calledAfterTaint() {
|
void calledAfterTaint() {
|
||||||
sink(*globalInt); // $ ir=576:17 MISSING: ast=576:17 SPURIOUS: ir=562:17
|
sink(*globalInt); // $ ir=562:17 ir=576:17 MISSING: ast=562:17 ast=576:17
|
||||||
}
|
}
|
||||||
|
|
||||||
void taintAndCall() {
|
void taintAndCall() {
|
||||||
globalInt = indirect_source();
|
globalInt = indirect_source();
|
||||||
calledAfterTaint();
|
calledAfterTaint();
|
||||||
sink(*globalInt); // $ ir=576:17 MISSING: ast=576:17 SPURIOUS: ir=562:17
|
sink(*globalInt); // $ ir=562:17 ir=576:17 MISSING: ast=562:17 ast=576:17
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user