Fix null dereference committed in r253277

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253393 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2015-11-17 22:39:26 +00:00
parent 6715b1eee1
commit 2fa6f196d6

View File

@ -38,8 +38,9 @@ DWARFUnit::DWARFUnit(DWARFContext &DC, const DWARFSection &Section,
const DWARFUnitIndex::Entry *IndexEntry)
: Context(DC), InfoSection(Section), Abbrev(DA), RangeSection(RS),
LineSection(LS), StringSection(SS), StringOffsetSection([&]() {
if (const auto *C = IndexEntry->getOffset(DW_SECT_STR_OFFSETS))
return SOS.slice(C->Offset, C->Offset + C->Length);
if (IndexEntry)
if (const auto *C = IndexEntry->getOffset(DW_SECT_STR_OFFSETS))
return SOS.slice(C->Offset, C->Offset + C->Length);
return SOS;
}()),
AddrOffsetSection(AOS), isLittleEndian(LE), UnitSection(UnitSection),