aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-11-06 18:24:05 +0000
committerDevang Patel <dpatel@apple.com>2009-11-06 18:24:05 +0000
commitd3a1626f2fc865dceffc949662bf31dc37e64a95 (patch)
treea02f7ec0c860ca99a9a0f89e431238d9ea098c3e /lib
parent52814ea97e6546388dc2460712ea6233389de475 (diff)
downloadexternal_llvm-d3a1626f2fc865dceffc949662bf31dc37e64a95.zip
external_llvm-d3a1626f2fc865dceffc949662bf31dc37e64a95.tar.gz
external_llvm-d3a1626f2fc865dceffc949662bf31dc37e64a95.tar.bz2
Tolerate invalid derived type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86269 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/DebugInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 7c1cc35..24b5ad4 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -409,6 +409,10 @@ uint64_t DIDerivedType::getOriginalTypeSize() const {
Tag == dwarf::DW_TAG_const_type || Tag == dwarf::DW_TAG_volatile_type ||
Tag == dwarf::DW_TAG_restrict_type) {
DIType BaseType = getTypeDerivedFrom();
+ // If this type is not derived from any type then take conservative
+ // approach.
+ if (BaseType.isNull())
+ return getSizeInBits();
if (BaseType.isDerivedType())
return DIDerivedType(BaseType.getNode()).getOriginalTypeSize();
else