Files
codeql/cpp/ql/test/successor-tests/dostmt/dostmt06.ql
2018-08-02 17:53:23 +01:00

28 lines
632 B
Plaintext

/**
* @name dostmt06
* @description Control flow test for always_false.
*/
import cpp
from Function f, ControlFlowNode n, ControlFlowNode s, int fStart, int nOffset, int sOffset
where
f.hasName("always_false")
and f = n.getControlFlowScope()
and s = n.getASuccessor()
and fStart = f.getLocation().getStartLine()
and
(
if(n.getLocation() instanceof UnknownLocation) then
nOffset = -1
else
nOffset = n.getLocation().getStartLine() - fStart
)
and
(
if(s.getLocation() instanceof UnknownLocation) then
sOffset = -1
else
sOffset = s.getLocation().getStartLine() - fStart
)
select nOffset, n, sOffset, s