Fix OutOfFuel trap code not represented in the C API. (#5230)
This commit adds the missing "out of fuel" trap code to the C API. Without this, calls to `wasmtime_trap_code` will trigger an unreachable panic on traps from running out of fuel.
This commit is contained in:
@@ -133,6 +133,8 @@ pub extern "C" fn wasmtime_trap_code(raw: &wasm_trap_t, code: &mut u8) -> bool {
|
||||
Trap::BadConversionToInteger => 8,
|
||||
Trap::UnreachableCodeReached => 9,
|
||||
Trap::Interrupt => 10,
|
||||
Trap::OutOfFuel => 11,
|
||||
Trap::AlwaysTrapAdapter => unreachable!("component model not supported"),
|
||||
_ => unreachable!(),
|
||||
};
|
||||
true
|
||||
|
||||
Reference in New Issue
Block a user