diff --git a/crates/wasmtime/src/trap.rs b/crates/wasmtime/src/trap.rs index 39f557dcf8..93dfe12a16 100644 --- a/crates/wasmtime/src/trap.rs +++ b/crates/wasmtime/src/trap.rs @@ -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) diff --git a/tests/all/traps.rs b/tests/all/traps.rs index 857c870359..998d11f908 100644 --- a/tests/all/traps.rs +++ b/tests/all/traps.rs @@ -160,7 +160,7 @@ fn trap_display_pretty() -> Result<()> { assert_eq!( e.to_string(), "\ -wasm trap: unreachable +wasm trap: wasm `unreachable` instruction executed wasm backtrace: 0: 0x23 - m!die 1: 0x27 - m! @@ -206,7 +206,7 @@ fn trap_display_multi_module() -> Result<()> { assert_eq!( e.to_string(), "\ -wasm trap: unreachable +wasm trap: wasm `unreachable` instruction executed wasm backtrace: 0: 0x23 - a!die 1: 0x27 - a! @@ -400,7 +400,7 @@ fn start_trap_pretty() -> Result<()> { assert_eq!( e.to_string(), "\ -wasm trap: unreachable +wasm trap: wasm `unreachable` instruction executed wasm backtrace: 0: 0x1d - m!die 1: 0x21 - m! @@ -565,7 +565,7 @@ fn no_hint_even_with_dwarf_info() -> Result<()> { assert_eq!( trap.to_string(), "\ -wasm trap: unreachable +wasm trap: wasm `unreachable` instruction executed wasm backtrace: 0: 0x1a - !start " @@ -600,7 +600,7 @@ fn hint_with_dwarf_info() -> Result<()> { assert_eq!( trap.to_string(), "\ -wasm trap: unreachable +wasm trap: wasm `unreachable` instruction executed wasm backtrace: 0: 0x1a - !start note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable to may show more debugging information