summaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-05-10 21:49:52 +0000
committerAnna Zaks <ganna@apple.com>2012-05-10 21:49:52 +0000
commitb3b1ae85757a8722caccb742b73ca31b4b53bb0a (patch)
treeaf9a909b57376e77c5a6ffaf983745e2159ec5e3 /lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
parent5f9688b7c7fdeafdf530056d49f82d2ec6ca457f (diff)
downloadclang-b3b1ae85757a8722caccb742b73ca31b4b53bb0a.tar.gz
[analyzer] Exit early if constraint solver is given a non-integer symbol
to reason about. As part of taint propagation, we now allow creation of non-integer symbolic expressions like a cast from int to float. Addresses PR12511 (radar://11215362). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156578 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp b/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
index 92a8eb1a7a..5568f1ca55 100644
--- a/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
+++ b/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
@@ -137,6 +137,11 @@ SimpleConstraintManager::assumeAuxForSymbol(ProgramStateRef State,
SymbolRef Sym, bool Assumption) {
BasicValueFactory &BVF = getBasicVals();
QualType T = Sym->getType(BVF.getContext());
+
+ // None of the constraint solvers currently support non-integer types.
+ if (!T->isIntegerType())
+ return State;
+
const llvm::APSInt &zero = BVF.getValue(0, T);
if (Assumption)
return assumeSymNE(State, Sym, zero, zero);