mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C++: Adjust the result type at 'NotExpr' and at comparisons.
This commit is contained in:
@@ -1323,6 +1323,8 @@ class TranslatedUnaryExpr extends TranslatedSingleInstructionExpr {
|
||||
class TranslatedNotExpr extends TranslatedNonConstantExpr {
|
||||
override NotExpr expr;
|
||||
|
||||
override Type getExprType() { result instanceof BoolType }
|
||||
|
||||
final override Instruction getFirstInstruction(EdgeKind kind) {
|
||||
result = this.getOperand().getFirstInstruction(kind)
|
||||
}
|
||||
@@ -1807,6 +1809,12 @@ class TranslatedBinaryOperation extends TranslatedSingleInstructionExpr {
|
||||
result = comparisonOpcode(expr)
|
||||
}
|
||||
|
||||
override Type getExprType() {
|
||||
if exists(comparisonOpcode(expr))
|
||||
then result instanceof BoolType
|
||||
else result = super.getExprType()
|
||||
}
|
||||
|
||||
override int getInstructionElementSize(InstructionTag tag) {
|
||||
tag = OnlyInstructionTag() and
|
||||
exists(Opcode opcode |
|
||||
|
||||
Reference in New Issue
Block a user