mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
C++: isConstant() -> exists(getValue())
This code was clearly using `isConstant` as an indirect way of checking whether `getValue` would have a result. That's no longer valid, so I changed it to check `getValue` directly.
This commit is contained in:
@@ -43,7 +43,7 @@ string comparisonOnLiterals(ComparisonOperation op) {
|
||||
simple(op.getLeftOperand()) and
|
||||
simple(op.getRightOperand()) and
|
||||
not op.getAnOperand().isInMacroExpansion() and
|
||||
if op.isConstant()
|
||||
if exists(op.getValue())
|
||||
then result = "This comparison involves two literals and is always " + op.getValue() + "."
|
||||
else result = "This comparison involves two literals and should be simplified."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user