From 648badb73051ad5f6aca655877509bfea1f12c6f Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Sat, 25 Dec 2021 00:28:29 -0800 Subject: [PATCH] fuzzbug fix --- src/frontend.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontend.rs b/src/frontend.rs index 1d23678..4afb1fc 100644 --- a/src/frontend.rs +++ b/src/frontend.rs @@ -575,12 +575,16 @@ impl<'a, 'b> FunctionBodyBuilder<'a, 'b> { wasmparser::Operator::LocalSet { local_index } => { let (_, value) = self.op_stack.pop().unwrap(); - self.locals.set(*local_index, value); + if self.cur_block.is_some() { + self.locals.set(*local_index, value); + } } wasmparser::Operator::LocalTee { local_index } => { let (_ty, value) = *self.op_stack.last().unwrap(); - self.locals.set(*local_index, value); + if self.cur_block.is_some() { + self.locals.set(*local_index, value); + } } wasmparser::Operator::Call { .. }