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

Skip to content

Commit 4e1a37c

Browse files
author
Robert Marsh
committed
C++: add isStrict to RelationalInstruction
1 parent 27a83e6 commit 4e1a37c

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,7 @@ class RelationalInstruction extends CompareInstruction {
974974

975975
abstract Instruction getGreaterOperand();
976976
abstract Instruction getLesserOperand();
977+
abstract predicate isStrict();
977978
}
978979

979980
class CompareLTInstruction extends RelationalInstruction {
@@ -988,6 +989,10 @@ class CompareLTInstruction extends RelationalInstruction {
988989
override Instruction getGreaterOperand() {
989990
result = getRightOperand()
990991
}
992+
993+
override predicate isStrict() {
994+
any()
995+
}
991996
}
992997

993998
class CompareGTInstruction extends RelationalInstruction {
@@ -1002,6 +1007,10 @@ class CompareGTInstruction extends RelationalInstruction {
10021007
override Instruction getGreaterOperand() {
10031008
result = getLeftOperand()
10041009
}
1010+
1011+
override predicate isStrict() {
1012+
any()
1013+
}
10051014
}
10061015

10071016
class CompareLEInstruction extends RelationalInstruction {
@@ -1016,6 +1025,10 @@ class CompareLEInstruction extends RelationalInstruction {
10161025
override Instruction getGreaterOperand() {
10171026
result = getRightOperand()
10181027
}
1028+
1029+
override predicate isStrict() {
1030+
none()
1031+
}
10191032
}
10201033

10211034
class CompareGEInstruction extends RelationalInstruction {
@@ -1030,6 +1043,10 @@ class CompareGEInstruction extends RelationalInstruction {
10301043
override Instruction getGreaterOperand() {
10311044
result = getLeftOperand()
10321045
}
1046+
1047+
override predicate isStrict() {
1048+
none()
1049+
}
10331050
}
10341051

10351052
class SwitchInstruction extends Instruction {

0 commit comments

Comments
 (0)