Make the trap name for unreachable traps more descriptive. (#3568)
Following up on WebAssembly/wasi-sdk#210, this makes the trap message for `unreachable` traps more descriptive of what actually caused the trap, so that it doesn't sound like maybe Wasmtime itself executed a `unreachable!()` macro in Rust. Before: ``` wasm trap: unreachable wasm backtrace: [...] ``` After: ``` wasm trap: wasm `unreachable` instruction executed wasm backtrace: [...] ```
This commit is contained in:
@@ -119,7 +119,7 @@ impl fmt::Display for TrapCode {
|
||||
IntegerOverflow => "integer overflow",
|
||||
IntegerDivisionByZero => "integer divide by zero",
|
||||
BadConversionToInteger => "invalid conversion to integer",
|
||||
UnreachableCodeReached => "unreachable",
|
||||
UnreachableCodeReached => "wasm `unreachable` instruction executed",
|
||||
Interrupt => "interrupt",
|
||||
};
|
||||
write!(f, "{}", desc)
|
||||
|
||||
Reference in New Issue
Block a user