Skip to content

Commit ae9e4a4

Browse files
Better error handling
1 parent cb85525 commit ae9e4a4

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
@@ -235,7 +235,8 @@ static unsigned writeCompressedReloc(uint8_t *buf, const WasmRelocation &rel,
235235
case R_WASM_TABLE_INDEX_REL_SLEB:
236236
return encodeSLEB128(static_cast<int64_t>(value), buf);
237237
default:
238-
llvm_unreachable("unexpected relocation type");
238+
fatal("relocation compression not supported for " +
239+
relocTypeToString(rel.Type));
239240
}
240241
}
241242

@@ -261,7 +262,8 @@ static unsigned getRelocWidthPadded(const WasmRelocation &rel) {
261262
case R_WASM_MEMORY_ADDR_TLS_SLEB64:
262263
return 10;
263264
default:
264-
llvm_unreachable("unexpected relocation type");
265+
fatal("relocation compression not supported for " +
266+
relocTypeToString(rel.Type));
265267
}
266268
}
267269

0 commit comments

Comments
 (0)