mirror of
https://github.com/github/codeql.git
synced 2026-05-14 11:19:27 +02:00
These use the annotated, self-verifying test files to check various consistency requirements. Some of these may be expressing the same thing in different ways, but it's fairly cheap to keep them around, so I have not attempted to produce a minimal set of queries for this.
18 lines
584 B
Plaintext
18 lines
584 B
Plaintext
/**
|
|
* Checks that every live (non-dead) annotation in the test function's
|
|
* own scope is reachable from the function entry in the CFG.
|
|
* Annotations in nested scopes (generators, async, lambdas, comprehensions)
|
|
* have separate CFGs and are excluded from this check.
|
|
*/
|
|
|
|
import python
|
|
import TimerUtils
|
|
|
|
from TimerCfgNode a, TestFunction f
|
|
where
|
|
not a.isDead() and
|
|
f = a.getTestFunction() and
|
|
a.getScope() = f and
|
|
not f.getEntryNode().getBasicBlock().reaches(a.getBasicBlock())
|
|
select a, "Unreachable live annotation; entry of $@ does not reach this node", f, f.getName()
|