summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/APValue.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-01-29 01:26:43 +0000
committerDouglas Gregor <dgregor@apple.com>2013-01-29 01:26:43 +0000
commit0b7bc7f99612e150304b83c5149b220b959b7341 (patch)
tree72dc135f9a071c2a1e589fe5136d6733e97fcaf8 /clang/lib/AST/APValue.cpp
parent0cdcc98200b8b2c0dea21bae433677f88aae597c (diff)
downloadbcm5719-llvm-0b7bc7f99612e150304b83c5149b220b959b7341.tar.gz
bcm5719-llvm-0b7bc7f99612e150304b83c5149b220b959b7341.zip
Don't crash while printing APValues that are lvalues casted to a
decidedly non-reference, non-pointer type. Fixes <rdar://problem/13090123>. llvm-svn: 173747
Diffstat (limited to 'clang/lib/AST/APValue.cpp')
-rw-r--r--clang/lib/AST/APValue.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/APValue.cpp b/clang/lib/AST/APValue.cpp
index 1676b7d4005..98e825b3baf 100644
--- a/clang/lib/AST/APValue.cpp
+++ b/clang/lib/AST/APValue.cpp
@@ -348,6 +348,8 @@ void APValue::printPretty(raw_ostream &Out, ASTContext &Ctx, QualType Ty) const{
bool IsReference = Ty->isReferenceType();
QualType InnerTy
= IsReference ? Ty.getNonReferenceType() : Ty->getPointeeType();
+ if (InnerTy.isNull())
+ InnerTy = Ty;
if (!hasLValuePath()) {
// No lvalue path: just print the offset.
OpenPOWER on IntegriCloud