itsrainy requested alexcrichton for a review on PR #5013.
itsrainy opened PR #5013 from rainy/minor-fuel-changes
to main
:
I ran into this when attempting to use
set_fuel
in a fuzz target (https://github.com/bytecodealliance/wasm-tools/pull/769).set_fuel
callsconsume_fuel(0)
in order to get the current amount of fuel in a Store. However,consume_fuel(0)
will return an out of fuel error if there is 0 fuel remaining, which is the case with a new Store.Switching the
<
to a<=
also has the effect of making this work:... let mut store = Store::new(&engine, ()); store.add_fuel(1).unwrap(); store.consume_fuel(1).unwrap();
previously this would have returned an "out of fuel" error, which doesn't seem correct, though maybe there's some nuance I'm missing?
itsrainy updated PR #5013 from rainy/minor-fuel-changes
to main
.
alexcrichton submitted PR review.
alexcrichton merged PR #5013.
Last updated: Dec 23 2024 at 12:05 UTC