aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2012-05-03 07:34:01 +0000
committerJordy Rose <jediknil@belkadan.com>2012-05-03 07:34:01 +0000
commit14d20b1dff6370f76279fcfb0fd780e2e5eb57bb (patch)
treec78c9f29ea42822e57660f4252dfb82bb2c3d893 /lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
parent9e607dd1dff375b4fa33d923ed592dad3ad43d42 (diff)
[analyzer] Equality ops are like relational ops in that the arguments shouldn't be converted to the result type. Fixes PR12206 and dupe PR12510.
This was probably the original intent of r133041 (also me, a year ago). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156062 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp b/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
index 4a4fcf3c1f..057b8c0adb 100644
--- a/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
+++ b/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
@@ -345,7 +345,7 @@ SVal SimpleSValBuilder::evalBinOpNN(ProgramStateRef state,
if (const llvm::APSInt *Constant = state->getSymVal(RSym)) {
// The symbol evaluates to a constant.
const llvm::APSInt *rhs_I;
- if (BinaryOperator::isRelationalOp(op))
+ if (BinaryOperator::isComparisonOp(op))
rhs_I = &BasicVals.Convert(lhsInt.getValue(), *Constant);
else
rhs_I = &BasicVals.Convert(resultTy, *Constant);
@@ -494,7 +494,7 @@ SVal SimpleSValBuilder::evalBinOpNN(ProgramStateRef state,
// The conversion type is usually the result type, but not in the case
// of relational expressions.
QualType conversionType = resultTy;
- if (BinaryOperator::isRelationalOp(op))
+ if (BinaryOperator::isComparisonOp(op))
conversionType = lhsType;
// Does the symbol simplify to a constant? If so, "fold" the constant