Skip to content

Commit 8f419d1

Browse files
committed
C++: Fix conflated-memory sanity query
I had included `InitializeNonLocal` in the recursion because it made everything look better in the presence of a bug that's since been fixed. Taking it out means the sanity test is again aligned with the old `isChiForAllAliasedMemory`.
1 parent 4e58886 commit 8f419d1

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IRSanity.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ module InstructionSanity {
280280
private predicate isOnAliasedDefinitionChain(Instruction instr) {
281281
instr instanceof AliasedDefinitionInstruction
282282
or
283-
instr.getOpcode() instanceof Opcode::InitializeNonLocal
284-
or
285283
isOnAliasedDefinitionChain(instr.(ChiInstruction).getTotal())
286284
or
287285
isOnAliasedDefinitionChain(instr.(PhiInstruction).getAnInputOperand().getAnyDef())
@@ -291,6 +289,8 @@ module InstructionSanity {
291289
isOnAliasedDefinitionChain(instr)
292290
or
293291
instr instanceof UnmodeledDefinitionInstruction
292+
or
293+
instr.getOpcode() instanceof Opcode::InitializeNonLocal
294294
}
295295

296296
query predicate notMarkedAsConflated(Instruction instr) {

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IRSanity.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ module InstructionSanity {
280280
private predicate isOnAliasedDefinitionChain(Instruction instr) {
281281
instr instanceof AliasedDefinitionInstruction
282282
or
283-
instr.getOpcode() instanceof Opcode::InitializeNonLocal
284-
or
285283
isOnAliasedDefinitionChain(instr.(ChiInstruction).getTotal())
286284
or
287285
isOnAliasedDefinitionChain(instr.(PhiInstruction).getAnInputOperand().getAnyDef())
@@ -291,6 +289,8 @@ module InstructionSanity {
291289
isOnAliasedDefinitionChain(instr)
292290
or
293291
instr instanceof UnmodeledDefinitionInstruction
292+
or
293+
instr.getOpcode() instanceof Opcode::InitializeNonLocal
294294
}
295295

296296
query predicate notMarkedAsConflated(Instruction instr) {

cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/IRSanity.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ module InstructionSanity {
280280
private predicate isOnAliasedDefinitionChain(Instruction instr) {
281281
instr instanceof AliasedDefinitionInstruction
282282
or
283-
instr.getOpcode() instanceof Opcode::InitializeNonLocal
284-
or
285283
isOnAliasedDefinitionChain(instr.(ChiInstruction).getTotal())
286284
or
287285
isOnAliasedDefinitionChain(instr.(PhiInstruction).getAnInputOperand().getAnyDef())
@@ -291,6 +289,8 @@ module InstructionSanity {
291289
isOnAliasedDefinitionChain(instr)
292290
or
293291
instr instanceof UnmodeledDefinitionInstruction
292+
or
293+
instr.getOpcode() instanceof Opcode::InitializeNonLocal
294294
}
295295

296296
query predicate notMarkedAsConflated(Instruction instr) {

csharp/ql/src/semmle/code/csharp/ir/implementation/raw/IRSanity.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ module InstructionSanity {
280280
private predicate isOnAliasedDefinitionChain(Instruction instr) {
281281
instr instanceof AliasedDefinitionInstruction
282282
or
283-
instr.getOpcode() instanceof Opcode::InitializeNonLocal
284-
or
285283
isOnAliasedDefinitionChain(instr.(ChiInstruction).getTotal())
286284
or
287285
isOnAliasedDefinitionChain(instr.(PhiInstruction).getAnInputOperand().getAnyDef())
@@ -291,6 +289,8 @@ module InstructionSanity {
291289
isOnAliasedDefinitionChain(instr)
292290
or
293291
instr instanceof UnmodeledDefinitionInstruction
292+
or
293+
instr.getOpcode() instanceof Opcode::InitializeNonLocal
294294
}
295295

296296
query predicate notMarkedAsConflated(Instruction instr) {

csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/IRSanity.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ module InstructionSanity {
280280
private predicate isOnAliasedDefinitionChain(Instruction instr) {
281281
instr instanceof AliasedDefinitionInstruction
282282
or
283-
instr.getOpcode() instanceof Opcode::InitializeNonLocal
284-
or
285283
isOnAliasedDefinitionChain(instr.(ChiInstruction).getTotal())
286284
or
287285
isOnAliasedDefinitionChain(instr.(PhiInstruction).getAnInputOperand().getAnyDef())
@@ -291,6 +289,8 @@ module InstructionSanity {
291289
isOnAliasedDefinitionChain(instr)
292290
or
293291
instr instanceof UnmodeledDefinitionInstruction
292+
or
293+
instr.getOpcode() instanceof Opcode::InitializeNonLocal
294294
}
295295

296296
query predicate notMarkedAsConflated(Instruction instr) {

0 commit comments

Comments
 (0)