diff --git a/src/protocol/tests/utils.rs b/src/protocol/tests/utils.rs index fa7153214d697f2f57231e79511d844c581a5442..63ff0f95929262c11c44f701f0f31015589658dd 100644 --- a/src/protocol/tests/utils.rs +++ b/src/protocol/tests/utils.rs @@ -535,6 +535,7 @@ impl<'a> FunctionTester<'a> { let mut found_local_id = None; if let Some(block_id) = wrapping_block_id { + // Found the right block, find the variable inside the block again let block_stmt = self.ctx.heap[block_id].as_block(); for local_id in &block_stmt.locals { let var = &self.ctx.heap[*local_id]; @@ -1194,6 +1195,12 @@ fn seek_expr_in_stmt bool>(heap: &Heap, start: StatementId let stmt = &heap[start]; match stmt { + Statement::Local(stmt) => { + match stmt { + LocalStatement::Memory(stmt) => seek_expr_in_expr(heap, stmt.initial_expr.upcast(), f), + LocalStatement::Channel(_) => None + } + } Statement::Block(stmt) => { for stmt_id in &stmt.statements { if let Some(id) = seek_expr_in_stmt(heap, *stmt_id, f) {