From c942da524ca9c44d6d15513f933e014a62efdcb4 Mon Sep 17 00:00:00 2001 From: Robert Marsh Date: Thu, 16 Jan 2020 07:16:57 -0800 Subject: [PATCH] C++/C#: Sync --- .../unaliased_ssa/internal/SSAConstruction.qll | 10 ++++++++-- .../unaliased_ssa/internal/SSAConstruction.qll | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll b/cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll index 9198b254250..b84c8c93be5 100644 --- a/cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll +++ b/cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll @@ -573,13 +573,19 @@ module DefUse { // An odd offset corresponds to the `Chi` instruction. defOffset = oldOffset * 2 + 1 and result = Chi(oldInstr) and - hasNonPhiDefinition(_, defLocation, defBlock, defOffset) and + ( + defLocation = Alias::getResultMemoryLocation(oldInstr) or + defLocation = Alias::getResultMemoryLocation(oldInstr).getVirtualVariable() + ) and actualDefLocation = defLocation.getVirtualVariable() or // An even offset corresponds to the original instruction. defOffset = oldOffset * 2 and result = getNewInstruction(oldInstr) and - hasNonPhiDefinition(_, defLocation, defBlock, defOffset) and + ( + defLocation = Alias::getResultMemoryLocation(oldInstr) or + defLocation = Alias::getResultMemoryLocation(oldInstr).getVirtualVariable() + ) and actualDefLocation = defLocation ) or diff --git a/csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll b/csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll index 9198b254250..b84c8c93be5 100644 --- a/csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll +++ b/csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll @@ -573,13 +573,19 @@ module DefUse { // An odd offset corresponds to the `Chi` instruction. defOffset = oldOffset * 2 + 1 and result = Chi(oldInstr) and - hasNonPhiDefinition(_, defLocation, defBlock, defOffset) and + ( + defLocation = Alias::getResultMemoryLocation(oldInstr) or + defLocation = Alias::getResultMemoryLocation(oldInstr).getVirtualVariable() + ) and actualDefLocation = defLocation.getVirtualVariable() or // An even offset corresponds to the original instruction. defOffset = oldOffset * 2 and result = getNewInstruction(oldInstr) and - hasNonPhiDefinition(_, defLocation, defBlock, defOffset) and + ( + defLocation = Alias::getResultMemoryLocation(oldInstr) or + defLocation = Alias::getResultMemoryLocation(oldInstr).getVirtualVariable() + ) and actualDefLocation = defLocation ) or