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
diff --git a/clang/lib/AST/APValue.cpp b/clang/lib/AST/APValue.cpp
index 1676b7d..98e825b 100644
--- a/clang/lib/AST/APValue.cpp
+++ b/clang/lib/AST/APValue.cpp
@@ -348,6 +348,8 @@
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.