Skip to content

Commit b884be8

Browse files
authored
[BOLT] Exit with error code on missing DWO CU (#125976)
If BOLT fails to locate DWO CU when using split DWARF, this signifies an issue with the input (missing .dwo) rather than an internal assertion.
1 parent 2feee52 commit b884be8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bolt/lib/Core/BinaryContext.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,11 @@ void BinaryContext::preprocessDebugInfo() {
17591759
dwarf::toString(CU->getUnitDIE().find(dwarf::DW_AT_name), nullptr);
17601760
if (std::optional<uint64_t> DWOID = CU->getDWOId()) {
17611761
auto Iter = DWOCUs.find(*DWOID);
1762-
assert(Iter != DWOCUs.end() && "DWO CU was not found.");
1762+
if (Iter == DWOCUs.end()) {
1763+
this->errs() << "BOLT-ERROR: DWO CU was not found for " << Name
1764+
<< '\n';
1765+
exit(1);
1766+
}
17631767
Name = dwarf::toString(
17641768
Iter->second->getUnitDIE().find(dwarf::DW_AT_name), nullptr);
17651769
}

0 commit comments

Comments
 (0)