aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-02-10 05:42:58 +0000
committerTed Kremenek <kremenek@apple.com>2009-02-10 05:42:58 +0000
commit3f34d80d0c4d7d3350b3eed3b80a9333663bb283 (patch)
tree7ff0e2a5280bc31e925afb5039c8a4b63b7a6c92 /lib
parent193cdbe73e77171a5800ca6ecd783d909764dc88 (diff)
Fix a crash in GRSimpleVals::EvalCast due not handling transparent unions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64200 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/GRSimpleVals.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Analysis/GRSimpleVals.cpp b/lib/Analysis/GRSimpleVals.cpp
index c1f455b2af..d50876e5b3 100644
--- a/lib/Analysis/GRSimpleVals.cpp
+++ b/lib/Analysis/GRSimpleVals.cpp
@@ -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);