summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-dwp/llvm-dwp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-dwp/llvm-dwp.cpp')
-rw-r--r--llvm/tools/llvm-dwp/llvm-dwp.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp
index 60d07207ed4..1e1cb527b28 100644
--- a/llvm/tools/llvm-dwp/llvm-dwp.cpp
+++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp
@@ -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);
OpenPOWER on IntegriCloud