Fix dropped memory grow

This commit is contained in:
Rerumu 2021-11-26 14:54:28 -05:00
parent 703e6b8e47
commit 83d3f16b42

View File

@ -360,9 +360,10 @@ impl<'a> Transformer<'a> {
let value = Box::new(self.living.pop().unwrap()); let value = Box::new(self.living.pop().unwrap());
// `MemoryGrow` is an expression *but* it has side effects // `MemoryGrow` is an expression *but* it has side effects
self.gen_leak_pending(&mut stat);
self.living self.living
.push(Expression::MemoryGrow(MemoryGrow { memory: *i, value })); .push(Expression::MemoryGrow(MemoryGrow { memory: *i, value }));
self.gen_leak_pending(&mut stat);
} }
Inst::I32Const(v) => self.push_constant(Value::I32(*v)), Inst::I32Const(v) => self.push_constant(Value::I32(*v)),
Inst::I64Const(v) => self.push_constant(Value::I64(*v)), Inst::I64Const(v) => self.push_constant(Value::I64(*v)),