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

14 lines
397 B
Plaintext

/**
* @name dostmt02
* @description The body of the do statement in normal is a successor of the condition.
*/
import cpp
from DoStmt ds
where
ds.getEnclosingFunction().hasName("normal")
and ds.getStmt() = ds.getCondition().getASuccessor()
and ds.getStmt() = ds.getCondition().getATrueSuccessor()
and count(ds.getCondition().getATrueSuccessor()) = 1
select ds.getCondition(), ds.getStmt()