summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/PDB
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-01-29 21:46:34 +0000
committerAdrian Prantl <aprantl@apple.com>2019-01-29 21:46:34 +0000
commitd55102a190d490cfd72b19708dfacecb70ac09f5 (patch)
treea5238ff7dd75823e47647ca87ced8a24db5b18aa /lldb/source/Plugins/SymbolFile/PDB
parent102c9ed768d534189bb51b53212dbba7eee9e412 (diff)
downloadbcm5719-llvm-d55102a190d490cfd72b19708dfacecb70ac09f5.tar.gz
bcm5719-llvm-d55102a190d490cfd72b19708dfacecb70ac09f5.zip
Make a blind attempt at fixing PDBASTParser nullability issues
llvm-svn: 352548
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/PDB')
-rw-r--r--lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
index 95ecf968546..82cfcfbb040 100644
--- a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -649,7 +649,9 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
assert(array_type);
uint32_t num_elements = array_type->getCount();
uint32_t element_uid = array_type->getElementTypeId();
- uint32_t bytes = array_type->getLength();
+ llvm::Optional<uint64_t> bytes;
+ if (uint64_t size = array_type->getLength())
+ bytes = size;
// If array rank > 0, PDB gives the element type at N=0. So element type
// will parsed in the order N=0, N=1,..., N=rank sequentially.
@@ -685,7 +687,9 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
if (builtin_kind == PDB_BuiltinType::None)
return nullptr;
- llvm::Optional<uint64_t> bytes = builtin_type->getLength();
+ llvm::Optional<uint64_t> bytes;
+ if (uint64_t size = builtin_type->getLength())
+ bytes = size;
Encoding encoding = TranslateBuiltinEncoding(builtin_kind);
CompilerType builtin_ast_type = GetBuiltinTypeForPDBEncodingAndBitSize(
m_ast, *builtin_type, encoding, bytes.getValueOr(0) * 8);
OpenPOWER on IntegriCloud