diff --git a/src/gas.rs b/src/gas.rs index fcac023..40aedb7 100644 --- a/src/gas.rs +++ b/src/gas.rs @@ -48,6 +48,10 @@ fn add_grow_counter(module: elements::Module, rules: &rules::Set, gas_func: u32) GetLocal(0), I32Const(rules.grow_cost() as i32), I32Mul, + CurrentMemory(0), + I32Const(1), + I32Add, + I32Mul, // todo: there should be strong guarantee that it does not return anything on stack? Call(gas_func), GrowMemory(0), @@ -244,6 +248,10 @@ mod tests { GetLocal(0), I32Const(10000), I32Mul, + CurrentMemory(0), + I32Const(1), + I32Add, + I32Mul, Call(0), GrowMemory(0), GetLocal(0),