mirror of
https://github.com/github/codeql.git
synced 2026-03-28 10:18:17 +01:00
15 lines
498 B
Plaintext
15 lines
498 B
Plaintext
/**
|
|
* @name dostmt04
|
|
* @description In normal, the do condition or one of the condition's descendants is the unique successor of the exit point of the last statement in the body.
|
|
*/
|
|
|
|
import cpp
|
|
|
|
from DoStmt ds, ExprStmt last, Expr succ
|
|
where
|
|
ds.getEnclosingFunction().hasName("normal")
|
|
and last = ((Block)ds.getStmt()).getLastStmt()
|
|
and succ = last.getExpr().getASuccessor()
|
|
and succ = ds.getCondition().getAChild*()
|
|
and count(last.getExpr().getASuccessor()) = 1
|
|
select last.getExpr(), succ |