Skip to content

Commit e78091e

Browse files
committed
C++: Sync identical files.
1 parent c10e00d commit e78091e

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -995,9 +995,8 @@ class ConstantInstruction extends ConstantValueInstruction {
995995
*/
996996
class IntegerConstantInstruction extends ConstantInstruction {
997997
IntegerConstantInstruction() {
998-
exists(IRType resultType |
999-
resultType = this.getResultIRType() and
1000-
(resultType instanceof IRIntegerType or resultType instanceof IRBooleanType)
998+
exists(IRType resultType | resultType = this.getResultIRType() |
999+
resultType instanceof IRIntegerType or resultType instanceof IRBooleanType
10011000
)
10021001
}
10031002
}
@@ -1009,6 +1008,17 @@ class FloatConstantInstruction extends ConstantInstruction {
10091008
FloatConstantInstruction() { this.getResultIRType() instanceof IRFloatingPointType }
10101009
}
10111010

1011+
/**
1012+
* An instruction whose result is a constant value of a pointer type.
1013+
*/
1014+
class PointerConstantInstruction extends ConstantInstruction {
1015+
PointerConstantInstruction() {
1016+
exists(IRType resultType | resultType = this.getResultIRType() |
1017+
resultType instanceof IRAddressType or resultType instanceof IRFunctionAddressType
1018+
)
1019+
}
1020+
}
1021+
10121022
/**
10131023
* An instruction whose result is the address of a string literal.
10141024
*/

cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -995,9 +995,8 @@ class ConstantInstruction extends ConstantValueInstruction {
995995
*/
996996
class IntegerConstantInstruction extends ConstantInstruction {
997997
IntegerConstantInstruction() {
998-
exists(IRType resultType |
999-
resultType = this.getResultIRType() and
1000-
(resultType instanceof IRIntegerType or resultType instanceof IRBooleanType)
998+
exists(IRType resultType | resultType = this.getResultIRType() |
999+
resultType instanceof IRIntegerType or resultType instanceof IRBooleanType
10011000
)
10021001
}
10031002
}
@@ -1009,6 +1008,17 @@ class FloatConstantInstruction extends ConstantInstruction {
10091008
FloatConstantInstruction() { this.getResultIRType() instanceof IRFloatingPointType }
10101009
}
10111010

1011+
/**
1012+
* An instruction whose result is a constant value of a pointer type.
1013+
*/
1014+
class PointerConstantInstruction extends ConstantInstruction {
1015+
PointerConstantInstruction() {
1016+
exists(IRType resultType | resultType = this.getResultIRType() |
1017+
resultType instanceof IRAddressType or resultType instanceof IRFunctionAddressType
1018+
)
1019+
}
1020+
}
1021+
10121022
/**
10131023
* An instruction whose result is the address of a string literal.
10141024
*/

0 commit comments

Comments
 (0)