aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/SValuator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Checker/SValuator.cpp')
-rw-r--r--lib/Checker/SValuator.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Checker/SValuator.cpp b/lib/Checker/SValuator.cpp
index 66cd3193b1..fd2bbd06fb 100644
--- a/lib/Checker/SValuator.cpp
+++ b/lib/Checker/SValuator.cpp
@@ -66,6 +66,12 @@ SValuator::CastResult SValuator::EvalCast(SVal val, const GRState *state,
if (C.hasSameUnqualifiedType(castTy, originalTy))
return CastResult(state, val);
+ // Check for casts to real or complex numbers. We don't handle these at all
+ // right now.
+ if (castTy->isFloatingType() || castTy->isAnyComplexType())
+ return CastResult(state, UnknownVal());
+
+ // Check for casts from integers to integers.
if (castTy->isIntegerType() && originalTy->isIntegerType())
return CastResult(state, EvalCastNL(cast<NonLoc>(val), castTy));