summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-09-18 18:58:58 +0000
committerJordan Rose <jordan_rose@apple.com>2013-09-18 18:58:58 +0000
commit36bc6b45590158fae555169677bc0b8d2103c588 (patch)
tree04b4829ec17ff7f877952cdf04b303bc64597a66 /clang/lib
parent5eef1ca1921918ac9940525063eeef3bd888b3a7 (diff)
downloadbcm5719-llvm-36bc6b45590158fae555169677bc0b8d2103c588.tar.gz
bcm5719-llvm-36bc6b45590158fae555169677bc0b8d2103c588.zip
[analyzer] Don't even try to convert floats to booleans for now.
We now have symbols with floating-point type to make sure that (double)x == (double)x comes out true, but we still can't do much with these. For now, don't even bother trying to create a floating-point zero value; just give up on conversion to bool. PR14634, C++ edition. llvm-svn: 190953
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Core/SValBuilder.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
index d615d3f5774..2142f06fef5 100644
--- a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
+++ b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
@@ -405,6 +405,10 @@ SVal SValBuilder::evalCast(SVal val, QualType castTy, QualType originalTy) {
return val;
if (val.isConstant())
return makeTruthVal(!val.isZeroConstant(), castTy);
+ if (!Loc::isLocType(originalTy) &&
+ !originalTy->isIntegralOrEnumerationType() &&
+ !originalTy->isMemberPointerType())
+ return UnknownVal();
if (SymbolRef Sym = val.getAsSymbol(true)) {
BasicValueFactory &BVF = getBasicValueFactory();
// FIXME: If we had a state here, we could see if the symbol is known to
OpenPOWER on IntegriCloud