[lld][WebAssembly] update error to continue for R_WASM_FUNCTION_INDEX_I32 (#162403)

with some builds we're getting
`[libcxx/include/optional:874](libcxx/include/optional): libc++
Hardening assertion this->has_value() failed: optional operator* called
on a disengaged value` since error() adds the errmsg into the stream and
continues, but given it's an unsupported relocation type it eventually
crashes.

Given that I see that we're already using Fatal() in some of the other
places where it hits unsupported relocation type, my uneducated guess is
that this should be fine.
This commit is contained in:
Kyungtak Woo
2025-10-07 20:54:23 -06:00
committed by GitHub
parent 34fda634f7
commit d9a568034f

View File

@@ -439,9 +439,11 @@ bool InputChunk::generateRelocationCode(raw_ostream &os) const {
if (!requiresRuntimeReloc)
continue;
if (!isValidRuntimeRelocation(rel.getType()))
if (!isValidRuntimeRelocation(rel.getType())) {
error("invalid runtime relocation type in data section: " +
relocTypetoString(rel.Type));
continue;
}
uint64_t offset = getVA(rel.Offset) - getInputSectionOffset();
LLVM_DEBUG(dbgs() << "gen reloc: type=" << relocTypeToString(rel.Type)