Fix null dereference committed in r253277

llvm-svn: 253393
This commit is contained in:
David Blaikie 2015-11-17 22:39:26 +00:00
parent 35c2eebfe4
commit 4689ef5943
1 changed files with 3 additions and 2 deletions

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),