mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
14 lines
406 B
Plaintext
14 lines
406 B
Plaintext
/**
|
|
* @name whilestmt02
|
|
* @description The body of the while statement in normal is a successor of the condition.
|
|
*/
|
|
|
|
import cpp
|
|
|
|
from WhileStmt ws
|
|
where
|
|
ws.getEnclosingFunction().hasName("normal")
|
|
and ws.getStmt() = ws.getCondition().getASuccessor()
|
|
and ws.getStmt() = ws.getCondition().getATrueSuccessor()
|
|
and count(ws.getCondition().getATrueSuccessor()) = 1
|
|
select ws.getCondition(), ws.getStmt() |