mirror of
https://github.com/github/codeql.git
synced 2026-04-23 07:45:17 +02:00
The predicate `maxSplits()` was previously applied dynamically to ensure that
any control flow node would keep track of at most `maxSplits()` number of splits.
However, there was no guarantee that two different copies of the same AST element
wouldn't contain different splits, so in general the number of copies for a given
AST element `e` could be on the order `$\binom{n}{k}c^k$`, where `n` is the total
number of splits that apply to `e`, `k = maxSplits()`, and `c` is a constant.
With this change, the relevant splits for `e` are instead computed statically,
meaning that the order is instead `$c^k$`.
8 lines
209 B
Plaintext
8 lines
209 B
Plaintext
import csharp
|
|
|
|
query predicate countSplits(ControlFlowElement cfe, int i) {
|
|
i = strictcount(ControlFlow::Nodes::ElementNode n | n.getElement() = cfe)
|
|
}
|
|
|
|
query predicate ssaDef(Ssa::Definition def) { any() }
|