summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2016-04-29 20:48:39 +0000
committerGreg Clayton <gclayton@apple.com>2016-04-29 20:48:39 +0000
commit909b277845a75595651de1e93b8e315d5d632077 (patch)
tree2c3ba4ab9ff16d1433949ab41bbffa1dcd9661d6 /lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
parent04d61050ea0c064520e0952497fbc5948d908662 (diff)
downloadbcm5719-llvm-909b277845a75595651de1e93b8e315d5d632077.tar.gz
bcm5719-llvm-909b277845a75595651de1e93b8e315d5d632077.zip
Make sure LLDB can deal with forward declarations to enums without crashing or asserting.
<rdar://problem/23776428> llvm-svn: 268098
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 62d8f890db8..0d53ccf7c42 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -1011,9 +1011,18 @@ DWARFASTParserClang::ParseTypeFromDWARF (const SymbolContext& sc,
}
if (!enumerator_clang_type)
- enumerator_clang_type = m_ast.GetBuiltinTypeForDWARFEncodingAndBitSize (NULL,
- DW_ATE_signed,
- byte_size * 8);
+ {
+ if (byte_size > 0)
+ {
+ enumerator_clang_type = m_ast.GetBuiltinTypeForDWARFEncodingAndBitSize(NULL,
+ DW_ATE_signed,
+ byte_size * 8);
+ }
+ else
+ {
+ enumerator_clang_type = m_ast.GetBasicType(eBasicTypeInt);
+ }
+ }
clang_type = m_ast.CreateEnumerationType (type_name_cstr,
GetClangDeclContextContainingDIE (die, nullptr),
OpenPOWER on IntegriCloud