forked from OSchip/llvm-project
llvm-dwp: Add error handling for multiple type sections in a dwp file.
llvm-svn: 269851
This commit is contained in:
parent
dd3c6b42c5
commit
8bef4125f2
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
RUN: not llvm-dwp %p/../Inputs/multiple_type_sections.dwp -o %t 2>&1 | FileCheck %s
|
||||
|
||||
CHECK: error: multiple type unit sections in .dwp file
|
|
@ -537,7 +537,9 @@ static Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
|
|||
}
|
||||
|
||||
if (!CurTypesSection.empty()) {
|
||||
assert(CurTypesSection.size() == 1);
|
||||
if (CurTypesSection.size() != 1)
|
||||
return make_error<DWPError>(
|
||||
"multiple type unit sections in .dwp file");
|
||||
DWARFUnitIndex TUIndex(DW_SECT_TYPES);
|
||||
DataExtractor TUIndexData(CurTUIndexSection,
|
||||
ErrOrObj->getBinary()->isLittleEndian(), 0);
|
||||
|
|
Loading…
Reference in New Issue