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 | 33e0c99d67a0f2b3107d66b91a46df894b322901 (patch) | |
| tree | 85f6d8576121058b08f2287e810fbdf6f118ae18 /llvm/lib | |
| parent | 25ed5c2f421a3cf57d6c693a839dfb17a50f397f (diff) | |
| download | bcm5719-llvm-33e0c99d67a0f2b3107d66b91a46df894b322901.tar.gz bcm5719-llvm-33e0c99d67a0f2b3107d66b91a46df894b322901.zip | |
Tolerate invalid derived type.
llvm-svn: 86269
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/DebugInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index 7c1cc35ee9d..24b5ad44f28 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/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 |

