Skip to content

Commit 4e58886

Browse files
committed
C++: Sync identical files
1 parent 2783214 commit 4e58886

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,18 @@ private module Cached {
7373
or
7474
instruction.getOpcode() instanceof Opcode::InitializeNonLocal
7575
or
76+
// Chi instructions track virtual variables, and therefore a chi instruction is
77+
// conflated if it's associated with the aliased virtual variable.
7678
exists(OldInstruction oldInstruction | instruction = Chi(oldInstruction) |
7779
Alias::getResultMemoryLocation(oldInstruction).getVirtualVariable() instanceof
7880
Alias::AliasedVirtualVariable
7981
)
8082
or
83+
// Phi instructions track locations, and therefore a phi instruction is
84+
// conflated if it's associated with a conflated location.
8185
exists(Alias::MemoryLocation location |
8286
instruction = Phi(_, location) and
83-
location.getVirtualVariable() instanceof Alias::AliasedVirtualVariable
87+
not exists(location.getAllocation())
8488
)
8589
}
8690

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,18 @@ private module Cached {
7373
or
7474
instruction.getOpcode() instanceof Opcode::InitializeNonLocal
7575
or
76+
// Chi instructions track virtual variables, and therefore a chi instruction is
77+
// conflated if it's associated with the aliased virtual variable.
7678
exists(OldInstruction oldInstruction | instruction = Chi(oldInstruction) |
7779
Alias::getResultMemoryLocation(oldInstruction).getVirtualVariable() instanceof
7880
Alias::AliasedVirtualVariable
7981
)
8082
or
83+
// Phi instructions track locations, and therefore a phi instruction is
84+
// conflated if it's associated with a conflated location.
8185
exists(Alias::MemoryLocation location |
8286
instruction = Phi(_, location) and
83-
location.getVirtualVariable() instanceof Alias::AliasedVirtualVariable
87+
not exists(location.getAllocation())
8488
)
8589
}
8690

0 commit comments

Comments
 (0)