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:
@@ -20,7 +20,8 @@ fn main() -> Result<()> {
|
||||
let fuel_before = store.fuel_consumed().unwrap();
|
||||
let output = match fibonacci.call(&mut store, n) {
|
||||
Ok(v) => v,
|
||||
Err(_) => {
|
||||
Err(e) => {
|
||||
assert_eq!(e.downcast::<Trap>()?, Trap::OutOfFuel);
|
||||
println!("Exhausted fuel computing fib({})", n);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user