| ... | ... | @@ -7096,19 +7096,8 @@ static IrInstruction *ir_gen_suspend(IrBuilder *irb, Scope *parent_scope, AstNod |
| 7096 | 7096 | if (node->data.suspend.block == nullptr) { |
| 7097 | 7097 | suspend_code = ir_build_coro_suspend(irb, parent_scope, node, nullptr, const_bool_false); |
| 7098 | 7098 | } else { |
| 7099 | | assert(node->data.suspend.promise_symbol != nullptr); |
| 7100 | | assert(node->data.suspend.promise_symbol->type == NodeTypeSymbol); |
| 7101 | | Buf *promise_symbol_name = node->data.suspend.promise_symbol->data.symbol_expr.symbol; |
| 7102 | 7099 | Scope *child_scope; |
| 7103 | | if (!buf_eql_str(promise_symbol_name, "_")) { |
| 7104 | | VariableTableEntry *promise_var = ir_create_var(irb, node, parent_scope, promise_symbol_name, |
| 7105 | | true, true, false, const_bool_false); |
| 7106 | | ir_build_var_decl(irb, parent_scope, node, promise_var, nullptr, nullptr, irb->exec->coro_handle); |
| 7107 | | child_scope = promise_var->child_scope; |
| 7108 | | } else { |
| 7109 | | child_scope = parent_scope; |
| 7110 | | } |
| 7111 | | ScopeSuspend *suspend_scope = create_suspend_scope(node, child_scope); |
| 7100 | ScopeSuspend *suspend_scope = create_suspend_scope(node, parent_scope); |
| 7112 | 7101 | suspend_scope->resume_block = resume_block; |
| 7113 | 7102 | child_scope = &suspend_scope->base; |
| 7114 | 7103 | IrInstruction *save_token = ir_build_coro_save(irb, child_scope, node, irb->exec->coro_handle); |