aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-10-25 20:09:21 +0000
committerTed Kremenek <kremenek@apple.com>2008-10-25 20:09:21 +0000
commit5b2316a8b695589f8e91baf1df06c1082ac94b6d (patch)
tree02a88249e6cecc30ef39c603089222d67c57543b /lib/Analysis/GRExprEngine.cpp
parenta40a357b0817b43e0ff639ce03733431743c225d (diff)
Do not crash when performing VisitLValue on union types.
This fixes PR 2948. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58148 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 7d60dec9b8..2a74311cd9 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -457,9 +457,10 @@ void GRExprEngine::VisitLValue(Expr* Ex, NodeTy* Pred, NodeSet& Dst) {
// can be used in a lvalue context. We need to enhance our support
// of such temporaries in both the environment and the store, so right
// now we just do a regular visit.
- assert (Ex->getType()->isAggregateType() &&
- "Other kinds of expressions with non-aggregate types do not "
- "have lvalues.");
+ assert ((Ex->getType()->isAggregateType() ||
+ Ex->getType()->isUnionType()) &&
+ "Other kinds of expressions with non-aggregate/union types do"
+ " not have lvalues.");
Visit(Ex, Pred, Dst);
}