From 1472b933cf9e6baba14299e107af9a5780db147e Mon Sep 17 00:00:00 2001 From: Kyungtak Woo Date: Tue, 7 Oct 2025 18:05:46 -0600 Subject: [PATCH 1/2] fix: update error to fatal to forcefully crash before evaluating unexpected crash --- lld/wasm/InputChunks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lld/wasm/InputChunks.cpp b/lld/wasm/InputChunks.cpp index 009869f1dcde1..74c6c1b7151f9 100644 --- a/lld/wasm/InputChunks.cpp +++ b/lld/wasm/InputChunks.cpp @@ -440,7 +440,7 @@ bool InputChunk::generateRelocationCode(raw_ostream &os) const { continue; if (!isValidRuntimeRelocation(rel.getType())) - error("invalid runtime relocation type in data section: " + + fatal("invalid runtime relocation type in data section: " + relocTypetoString(rel.Type)); uint64_t offset = getVA(rel.Offset) - getInputSectionOffset(); From 3d767af98ff4978ac8e458cb1b339acc2346e79e Mon Sep 17 00:00:00 2001 From: Kyungtak Woo Date: Tue, 7 Oct 2025 18:26:14 -0600 Subject: [PATCH 2/2] fix: update fatal to error with continue --- lld/wasm/InputChunks.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lld/wasm/InputChunks.cpp b/lld/wasm/InputChunks.cpp index 74c6c1b7151f9..44927e7a432bc 100644 --- a/lld/wasm/InputChunks.cpp +++ b/lld/wasm/InputChunks.cpp @@ -439,9 +439,11 @@ bool InputChunk::generateRelocationCode(raw_ostream &os) const { if (!requiresRuntimeReloc) continue; - if (!isValidRuntimeRelocation(rel.getType())) - fatal("invalid runtime relocation type in data section: " + + 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)