diff --git a/src/protocol/parser/pass_rewriting.rs b/src/protocol/parser/pass_rewriting.rs index 99d2abe78fd4ca490f99cdf3503ca94e6799d2f2..ccbfca20870bad54d815d7c84983fd2c025bb478 100644 --- a/src/protocol/parser/pass_rewriting.rs +++ b/src/protocol/parser/pass_rewriting.rs @@ -306,6 +306,12 @@ impl Visitor for PassRewriting { last_stmt_id = stmt_id; } + if total_num_cases == 0 { + // If we don't have any cases, then we didn't connect the statements + // up to the end of the outer block, so do that here + set_ast_statement_next(ctx, last_stmt_id, outer_end_block_id.upcast()); + } + let outer_block_stmt = &mut ctx.heap[outer_block_id]; outer_block_stmt.next = first_stmt_id; outer_block_stmt.statements = transformed_stmts;