Skip to content

Commit 7773cc5

Browse files
Fix crash in clang/test/CAS/cas-backend.c
PR llvm#68242 changed DWARFUnitHeader::extract to return an Error, which had to be correctly handled in MCCAS. This change fixes that issue.
1 parent 15a75a9 commit 7773cc5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/MCCAS/MCCASObjectV1.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,8 +1995,10 @@ Error InMemoryCASDWARFObject::partitionCUData(ArrayRef<char> DebugInfoData,
19951995
uint64_t OffsetPtr = 0;
19961996
DWARFUnitHeader Header;
19971997
DWARFSection Section = {toStringRef(DebugInfoData), 0 /*Address*/};
1998-
Header.extract(*Ctx, DWARFDataExtractor(*this, Section, isLittleEndian(), 8),
1999-
&OffsetPtr, DWARFSectionKind::DW_SECT_INFO);
1998+
if (Error E = Header.extract(
1999+
*Ctx, DWARFDataExtractor(*this, Section, isLittleEndian(), 8),
2000+
&OffsetPtr, DWARFSectionKind::DW_SECT_INFO))
2001+
return E;
20002002

20012003
DWARFUnitVector UV;
20022004
DWARFCompileUnit DCU(*Ctx, Section, Header, &Abbrev, &getRangesSection(),

0 commit comments

Comments
 (0)