Files
codeql/cpp/ql/test/library-tests/destructors/jump_destructs.ql
2018-08-02 17:53:23 +01:00

23 lines
574 B
Plaintext

import cpp
ControlFlowNode getANonLabelSuccessor(ControlFlowNode n) {
n.getASuccessor() = result and not result instanceof LabelStmt
}
class Jump extends Locatable {
Jump() {
this instanceof GotoStmt or
this instanceof ReturnStmt
}
}
from Jump j, ControlFlowNode n
where getANonLabelSuccessor+(j) = n
select j.(ControlFlowNode).getControlFlowScope(),
j.getLocation().getStartLine(),
j.toString(),
count(n.getAPredecessor*()), // Improves the output's sort order
n.getLocation().getStartLine(),
n.toString()