Skip to content

Commit 34e2f30

Browse files
Better error handling
1 parent 6e1ccf9 commit 34e2f30

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lld/wasm/InputChunks.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ static unsigned writeCompressedReloc(uint8_t *buf, const WasmRelocation &rel,
249249
case R_WASM_TABLE_INDEX_REL_SLEB:
250250
return encodeSLEB128(static_cast<int64_t>(value), buf);
251251
default:
252-
llvm_unreachable("unexpected relocation type");
252+
fatal("relocation compression not supported for " +
253+
relocTypeToString(rel.Type));
253254
}
254255
}
255256

@@ -275,7 +276,8 @@ static unsigned getRelocWidthPadded(const WasmRelocation &rel) {
275276
case R_WASM_MEMORY_ADDR_TLS_SLEB64:
276277
return 10;
277278
default:
278-
llvm_unreachable("unexpected relocation type");
279+
fatal("relocation compression not supported for " +
280+
relocTypeToString(rel.Type));
279281
}
280282
}
281283

0 commit comments

Comments
 (0)