diff options
author | Devang Patel <dpatel@apple.com> | 2009-11-06 18:24:05 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-11-06 18:24:05 +0000 |
commit | 5ebfa2d181dccee5e23421a41910a7a1851d358e (patch) | |
tree | a02f7ec0c860ca99a9a0f89e431238d9ea098c3e /lib/Analysis/DebugInfo.cpp | |
parent | f7807f6b9e9a215f365ce98a4c252aced4f651fb (diff) |
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/Analysis/DebugInfo.cpp')
-rw-r--r-- | lib/Analysis/DebugInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 7c1cc35ee9..24b5ad44f2 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 |