mirror of
https://github.com/github/codeql.git
synced 2026-03-28 10:18:17 +01:00
28 lines
634 B
Plaintext
28 lines
634 B
Plaintext
/**
|
|
* @name dostmt09
|
|
* @description Control flow test for always_true_3.
|
|
*/
|
|
|
|
import cpp
|
|
|
|
from Function f, ControlFlowNode n, ControlFlowNode s, int fStart, int nOffset, int sOffset
|
|
where
|
|
f.hasName("always_true_3")
|
|
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 |