Skip to content

Commit c942da5

Browse files
author
Robert Marsh
committed
C++/C#: Sync
1 parent 1b5d330 commit c942da5

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,13 +573,19 @@ module DefUse {
573573
// An odd offset corresponds to the `Chi` instruction.
574574
defOffset = oldOffset * 2 + 1 and
575575
result = Chi(oldInstr) and
576-
hasNonPhiDefinition(_, defLocation, defBlock, defOffset) and
576+
(
577+
defLocation = Alias::getResultMemoryLocation(oldInstr) or
578+
defLocation = Alias::getResultMemoryLocation(oldInstr).getVirtualVariable()
579+
) and
577580
actualDefLocation = defLocation.getVirtualVariable()
578581
or
579582
// An even offset corresponds to the original instruction.
580583
defOffset = oldOffset * 2 and
581584
result = getNewInstruction(oldInstr) and
582-
hasNonPhiDefinition(_, defLocation, defBlock, defOffset) and
585+
(
586+
defLocation = Alias::getResultMemoryLocation(oldInstr) or
587+
defLocation = Alias::getResultMemoryLocation(oldInstr).getVirtualVariable()
588+
) and
583589
actualDefLocation = defLocation
584590
)
585591
or

csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,13 +573,19 @@ module DefUse {
573573
// An odd offset corresponds to the `Chi` instruction.
574574
defOffset = oldOffset * 2 + 1 and
575575
result = Chi(oldInstr) and
576-
hasNonPhiDefinition(_, defLocation, defBlock, defOffset) and
576+
(
577+
defLocation = Alias::getResultMemoryLocation(oldInstr) or
578+
defLocation = Alias::getResultMemoryLocation(oldInstr).getVirtualVariable()
579+
) and
577580
actualDefLocation = defLocation.getVirtualVariable()
578581
or
579582
// An even offset corresponds to the original instruction.
580583
defOffset = oldOffset * 2 and
581584
result = getNewInstruction(oldInstr) and
582-
hasNonPhiDefinition(_, defLocation, defBlock, defOffset) and
585+
(
586+
defLocation = Alias::getResultMemoryLocation(oldInstr) or
587+
defLocation = Alias::getResultMemoryLocation(oldInstr).getVirtualVariable()
588+
) and
583589
actualDefLocation = defLocation
584590
)
585591
or

0 commit comments

Comments
 (0)