Skip to content

Commit 782b6cf

Browse files
committed
SSA: Fix bug in guards for ssa input nodes.
1 parent 88fe4fa commit 782b6cf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

shared/ssa/codeql/ssa/Ssa.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,8 +1574,12 @@ module Make<LocationSig Location, InputSig<Location> Input> {
15741574
}
15751575

15761576
cached
1577-
private DefinitionExt getAPhiInputDef(SsaInputDefinitionExt phi, BasicBlock bb) {
1578-
phi.hasInputFromBlock(result, _, _, _, bb)
1577+
private Definition getAPhiInputDef(SsaInputDefinitionExt phi, BasicBlock bb) {
1578+
exists(SourceVariable v, BasicBlock bbDef |
1579+
phi.definesAt(v, bbDef, _, _) and
1580+
getABasicBlockPredecessor(bbDef) = bb and
1581+
ssaDefReachesEndOfBlock(bb, result, v)
1582+
)
15791583
}
15801584

15811585
private newtype TNode =

0 commit comments

Comments
 (0)