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

18 lines
384 B
Plaintext

// Every reachable node has a dominator
import cpp
import semmle.code.cpp.controlflow.Dominance
ControlFlowNode reachableIn(Function func) {
result = func.getEntryPoint()
or result = reachableIn(func).getASuccessor()
}
from Function func, ControlFlowNode node
where
node = reachableIn(func)
and node != func.getEntryPoint()
and not iDominates(_, node)
select func, node