mirror of
https://github.com/github/codeql.git
synced 2026-05-14 11:19:27 +02:00
This one demonstrates a bug in the current CFG. In a dictionary
comprehension `{k: v for k, v in d.items()}`, we evaluate the value
before the key, which is incorrect. (A fix for this bug has been
implemented in a separate PR.)
17 lines
541 B
Plaintext
17 lines
541 B
Plaintext
/**
|
|
* Checks that within a single basic block, annotations appear in
|
|
* increasing minimum-timestamp order.
|
|
*/
|
|
|
|
import python
|
|
import TimerUtils
|
|
|
|
from TimerCfgNode a, TimerCfgNode b, int minA, int minB
|
|
where
|
|
exists(BasicBlock bb, int i, int j | a = bb.getNode(i) and b = bb.getNode(j) and i < j) and
|
|
minA = min(a.getATimestamp()) and
|
|
minB = min(b.getATimestamp()) and
|
|
minA >= minB
|
|
select a, "Basic block ordering: $@ appears before $@", a.getTimestampExpr(minA),
|
|
"timestamp " + minA, b.getTimestampExpr(minB), "timestamp " + minB
|