Skip to content

Commit

Permalink
Configure fuel specified in wasmtime wast (#10121)
Browse files Browse the repository at this point in the history
Otherwise if specified no fuel is injected and wasm execution always
traps.
  • Loading branch information
alexcrichton authored Jan 27, 2025
1 parent 5544100 commit bea7b2c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/commands/wast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ impl WastCommand {
self.common.init_logging()?;

let config = self.common.config(None)?;
let store = Store::new(&Engine::new(&config)?, ());
let mut store = Store::new(&Engine::new(&config)?, ());
if let Some(fuel) = self.common.wasm.fuel {
store.set_fuel(fuel)?;
}
let mut wast_context = WastContext::new(store);

wast_context
Expand Down

0 comments on commit bea7b2c

Please # to comment.