summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-10-26 01:16:26 +0000
committerJordan Rose <jordan_rose@apple.com>2013-10-26 01:16:26 +0000
commite692cfa330c36e173bdb5b092942957e5402d23c (patch)
treef89a0ce9d5f84bec0918a5d73355503a6cb0de05 /clang/lib
parent863931c990e1242d679b1516791ceab7791431a0 (diff)
downloadbcm5719-llvm-e692cfa330c36e173bdb5b092942957e5402d23c.tar.gz
bcm5719-llvm-e692cfa330c36e173bdb5b092942957e5402d23c.zip
[analyzer] Don't emit an "Assuming x is <OP> y" if it's not a comparison op.
We could certainly be more precise in many of our diagnostics, but before we were printing "Assuming x is && y", which is just ridiculous. <rdar://problem/15167979> llvm-svn: 193455
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
index fc81d1cc11e..aaec658e06f 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -1357,7 +1357,8 @@ ConditionBRVisitor::VisitTrueTest(const Expr *Cond,
// For non-assignment operations, we require that we can understand
// both the LHS and RHS.
- if (LhsString.empty() || RhsString.empty())
+ if (LhsString.empty() || RhsString.empty() ||
+ !BinaryOperator::isComparisonOp(Op))
return 0;
// Should we invert the strings if the LHS is not a variable name?
OpenPOWER on IntegriCloud