mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-30 23:20:54 +00:00
llvm-dwp: Add error handling for multiple type sections in a dwp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269851 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d640f9183d
commit
7fdce00ff3
BIN
test/tools/llvm-dwp/Inputs/multiple_type_sections.dwp
Normal file
BIN
test/tools/llvm-dwp/Inputs/multiple_type_sections.dwp
Normal file
Binary file not shown.
3
test/tools/llvm-dwp/X86/multiple_type_sections.test
Normal file
3
test/tools/llvm-dwp/X86/multiple_type_sections.test
Normal file
@ -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
Block a user