Explicitly check for casts to double or complex types instead of possibly asserting in SValuator.
llvm-svn: 95128
diff --git a/clang/lib/Checker/SValuator.cpp b/clang/lib/Checker/SValuator.cpp
index 66cd319..fd2bbd0 100644
--- a/clang/lib/Checker/SValuator.cpp
+++ b/clang/lib/Checker/SValuator.cpp
@@ -66,6 +66,12 @@
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));