Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 121c5e4

Browse files
committed
C++: Check that there is only one overlap
1 parent e1644dd commit 121c5e4

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@ newtype TValueNumber =
6161
*/
6262
class CongruentCopyInstruction extends CopyInstruction {
6363
CongruentCopyInstruction() {
64+
strictcount(this.getSourceValueOperand().getDefinitionOverlap()) = 1 and
6465
this.getSourceValueOperand().getDefinitionOverlap() instanceof MustExactlyOverlap
6566
}
6667
}
6768

6869
class LoadTotalOverlapInstruction extends LoadInstruction {
6970
LoadTotalOverlapInstruction() {
71+
strictcount(this.getSourceValueOperand().getDefinitionOverlap()) = 1 and
7072
this.getSourceValueOperand().getDefinitionOverlap() instanceof MustTotallyOverlap
7173
}
7274
}

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/gvn/internal/ValueNumberingInternal.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@ newtype TValueNumber =
6161
*/
6262
class CongruentCopyInstruction extends CopyInstruction {
6363
CongruentCopyInstruction() {
64+
strictcount(this.getSourceValueOperand().getDefinitionOverlap()) = 1 and
6465
this.getSourceValueOperand().getDefinitionOverlap() instanceof MustExactlyOverlap
6566
}
6667
}
6768

6869
class LoadTotalOverlapInstruction extends LoadInstruction {
6970
LoadTotalOverlapInstruction() {
71+
strictcount(this.getSourceValueOperand().getDefinitionOverlap()) = 1 and
7072
this.getSourceValueOperand().getDefinitionOverlap() instanceof MustTotallyOverlap
7173
}
7274
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@ newtype TValueNumber =
6161
*/
6262
class CongruentCopyInstruction extends CopyInstruction {
6363
CongruentCopyInstruction() {
64+
strictcount(this.getSourceValueOperand().getDefinitionOverlap()) = 1 and
6465
this.getSourceValueOperand().getDefinitionOverlap() instanceof MustExactlyOverlap
6566
}
6667
}
6768

6869
class LoadTotalOverlapInstruction extends LoadInstruction {
6970
LoadTotalOverlapInstruction() {
71+
strictcount(this.getSourceValueOperand().getDefinitionOverlap()) = 1 and
7072
this.getSourceValueOperand().getDefinitionOverlap() instanceof MustTotallyOverlap
7173
}
7274
}

0 commit comments

Comments
 (0)