Skip to content

Commit 4331b9b

Browse files
author
Dave Bartolomeo
committed
C++: Simplify logic to an implication
1 parent 41df700 commit 4331b9b

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ private module Cached {
5151

5252
cached
5353
predicate hasInstruction(TStageInstruction instr) {
54-
instr instanceof TRawInstruction and instr instanceof OldInstruction
55-
or
56-
not instr instanceof TRawInstruction
54+
instr instanceof TRawInstruction implies instr instanceof OldInstruction
5755
}
5856

5957
private IRBlock getNewBlock(OldBlock oldBlock) {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ private module Cached {
5151

5252
cached
5353
predicate hasInstruction(TStageInstruction instr) {
54-
instr instanceof TRawInstruction and instr instanceof OldInstruction
55-
or
56-
not instr instanceof TRawInstruction
54+
instr instanceof TRawInstruction implies instr instanceof OldInstruction
5755
}
5856

5957
private IRBlock getNewBlock(OldBlock oldBlock) {

csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ private module Cached {
5151

5252
cached
5353
predicate hasInstruction(TStageInstruction instr) {
54-
instr instanceof TRawInstruction and instr instanceof OldInstruction
55-
or
56-
not instr instanceof TRawInstruction
54+
instr instanceof TRawInstruction implies instr instanceof OldInstruction
5755
}
5856

5957
private IRBlock getNewBlock(OldBlock oldBlock) {

0 commit comments

Comments
 (0)