Skip to content

Commit 36532bc

Browse files
committed
SSA: Skip identity steps.
1 parent 4e2ad97 commit 36532bc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

shared/ssa/codeql/ssa/Ssa.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1942,14 +1942,16 @@ module Make<LocationSig Location, InputSig<Location> Input> {
19421942
or
19431943
exists(BasicBlock bb1, int i1 |
19441944
flowOutOf(nodeFrom, v, bb1, i1, isUseStep) and
1945-
flowFromRefToNode(v, bb1, i1, nodeTo)
1945+
flowFromRefToNode(v, bb1, i1, nodeTo) and
1946+
nodeFrom != nodeTo
19461947
)
19471948
or
19481949
// Flow from input node to def
19491950
exists(DefinitionExt phi, BasicBlock bbPhi |
19501951
phi = nodeFrom.(SsaInputNodeImpl).getPhi() and
19511952
phi.definesAt(v, bbPhi, _, _) and
19521953
isUseStep = false and
1954+
nodeFrom != nodeTo and
19531955
if phiHasUniqNextNode(phi)
19541956
then flowFromRefToNode(v, bbPhi, -1, nodeTo)
19551957
else nodeTo.(SsaDefinitionExtNodeImpl).getDefExt() = phi

0 commit comments

Comments
 (0)