summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-09-01 17:39:17 +0000
committerJordan Rose <jordan_rose@apple.com>2012-09-01 17:39:17 +0000
commita44ad1b35c9f411dcf56058e70468da75dbbe126 (patch)
treea59394d0ccf718bdbb662275a219f4066b317660 /clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
parentccf192e469a802bf7527c6b4b9c3fe5f3982999f (diff)
downloadbcm5719-llvm-a44ad1b35c9f411dcf56058e70468da75dbbe126.tar.gz
bcm5719-llvm-a44ad1b35c9f411dcf56058e70468da75dbbe126.zip
[analyzer] Don't attempt to create a floating-point value of "1" for ++/--.
The current logic would actually create a float- or double-sized signed integer value of 1, which is not at all the same. No test because the value would be swallowed by an Unknown as soon as it gets added or subtracted to the original value, but it enables the cleanup in the next patch. llvm-svn: 163068
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
index 8881f26366b..3bf16fa0da6 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
@@ -857,8 +857,10 @@ void ExprEngine::VisitIncrementDecrementOperator(const UnaryOperator* U,
if (U->getType()->isAnyPointerType())
RHS = svalBuilder.makeArrayIndex(1);
- else
+ else if (U->getType()->isIntegralOrEnumerationType())
RHS = svalBuilder.makeIntVal(1, U->getType());
+ else
+ RHS = UnknownVal();
SVal Result = evalBinOp(state, Op, V2, RHS, U->getType());
OpenPOWER on IntegriCloud