Files
codeql/python/ql/test/library-tests/ControlFlow/evaluation-order/BasicBlockOrdering.ql
Taus e5943cd4f7 Python: Add BasicBlockOrdering test
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.)
2026-04-28 15:38:04 +00:00

18 lines
505 B
Plaintext

/**
* Checks that within a single basic block, annotations appear in
* increasing minimum-timestamp order.
*/
import TimerUtils
import OldCfgImpl
private module Utils = EvalOrderCfgUtils<OldCfg>;
private import Utils
private import Utils::CfgTests
from TimerCfgNode a, TimerCfgNode b, int minA, int minB
where basicBlockOrdering(a, b, minA, minB)
select a, "Basic block ordering: $@ appears before $@", a.getTimestampExpr(minA),
"timestamp " + minA, b.getTimestampExpr(minB), "timestamp " + minB