From 33e0c99d67a0f2b3107d66b91a46df894b322901 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Fri, 6 Nov 2009 18:24:05 +0000 Subject: Tolerate invalid derived type. llvm-svn: 86269 --- llvm/lib/Analysis/DebugInfo.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/Analysis') 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 -- cgit v1.2.3