]> granicus.if.org Git - clang/commitdiff
Fix a crash in GRSimpleVals::EvalCast due not handling transparent unions.
authorTed Kremenek <kremenek@apple.com>
Tue, 10 Feb 2009 05:42:58 +0000 (05:42 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 10 Feb 2009 05:42:58 +0000 (05:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64200 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/GRSimpleVals.cpp

index c1f455b2af2e98f9df422d7d6720ae4e1ea7e8a0..d50876e5b30edebdecbbc38bbe6af383b1a53556 100644 (file)
@@ -74,6 +74,11 @@ SVal GRSimpleVals::EvalCast(GRExprEngine& Eng, Loc X, QualType T) {
   if (Loc::IsLocType(T) || T->isReferenceType())
     return X;
   
+  // FIXME: Handle transparent unions where a value can be "transparently"
+  //  lifted into a union type.
+  if (T->isUnionType())
+    return UnknownVal();
+  
   assert (T->isIntegerType());
   BasicValueFactory& BasicVals = Eng.getBasicVals();
   unsigned BitWidth = Eng.getContext().getTypeSize(T);