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:
Jeroen Ketema
2023-02-10 10:21:04 +01:00
committed by GitHub

View File

@@ -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
} }
} }