mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
SSA: Make phiWithoutTwoPriorRefs consistency check more informative
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
uselessPhiNode
|
||||
| sqlx.rs:155:5:157:5 | phi | 1 |
|
||||
| sqlx.rs:155:5:157:5 | SSA phi(arg0) | 1 |
|
||||
phiWithoutTwoPriorRefs
|
||||
| sqlx.rs:155:5:157:5 | phi | 1 |
|
||||
| sqlx.rs:155:5:157:5 | SSA phi(arg0) | sqlx.rs:155:5:157:5 | if enable_remote {...} | sqlx.rs:156:17:156:86 | arg0 | 1 |
|
||||
|
||||
@@ -1412,13 +1412,12 @@ module Make<LocationSig Location, InputSig<Location> Input> {
|
||||
}
|
||||
|
||||
/** Holds if `phi` has less than 2 immediately prior references. */
|
||||
query predicate phiWithoutTwoPriorRefs(PhiNode phi, int inputRefs) {
|
||||
exists(BasicBlock bbPhi, SourceVariable v |
|
||||
phi.definesAt(v, bbPhi, _) and
|
||||
inputRefs =
|
||||
count(BasicBlock bb, int i | AdjacentSsaRefs::adjacentRefPhi(bb, i, _, bbPhi, v)) and
|
||||
inputRefs < 2
|
||||
)
|
||||
query predicate phiWithoutTwoPriorRefs(
|
||||
PhiNode phi, BasicBlock bbPhi, SourceVariable v, int inputRefs
|
||||
) {
|
||||
phi.definesAt(v, bbPhi, _) and
|
||||
inputRefs = count(BasicBlock bb, int i | AdjacentSsaRefs::adjacentRefPhi(bb, i, _, bbPhi, v)) and
|
||||
inputRefs < 2
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user