| ... | @@ -5701,23 +5701,30 @@ static ZigType *get_async_fn_type(CodeGen *g, ZigType *orig_fn_type) { | ... | @@ -5701,23 +5701,30 @@ static ZigType *get_async_fn_type(CodeGen *g, ZigType *orig_fn_type) { |
| 5701 | // (await y) + x | 5701 | // (await y) + x |
| 5702 | static void mark_suspension_point(Scope *scope) { | 5702 | static void mark_suspension_point(Scope *scope) { |
| 5703 | ScopeExpr *child_expr_scope = (scope->id == ScopeIdExpr) ? reinterpret_cast<ScopeExpr *>(scope) : nullptr; | 5703 | ScopeExpr *child_expr_scope = (scope->id == ScopeIdExpr) ? reinterpret_cast<ScopeExpr *>(scope) : nullptr; |
| | 5704 | bool looking_for_exprs = true; |
| 5704 | for (;;) { | 5705 | for (;;) { |
| 5705 | scope = scope->parent; | 5706 | scope = scope->parent; |
| 5706 | switch (scope->id) { | 5707 | switch (scope->id) { |
| 5707 | case ScopeIdDefer: | | |
| 5708 | case ScopeIdDeferExpr: | 5708 | case ScopeIdDeferExpr: |
| 5709 | case ScopeIdDecls: | 5709 | case ScopeIdDecls: |
| 5710 | case ScopeIdFnDef: | 5710 | case ScopeIdFnDef: |
| 5711 | case ScopeIdCompTime: | 5711 | case ScopeIdCompTime: |
| 5712 | case ScopeIdVarDecl: | | |
| 5713 | case ScopeIdCImport: | 5712 | case ScopeIdCImport: |
| 5714 | case ScopeIdSuspend: | 5713 | case ScopeIdSuspend: |
| 5715 | case ScopeIdTypeOf: | 5714 | case ScopeIdTypeOf: |
| 5716 | return; | 5715 | return; |
| | 5716 | case ScopeIdVarDecl: |
| | 5717 | case ScopeIdDefer: |
| | 5718 | looking_for_exprs = false; |
| | 5719 | continue; |
| 5717 | case ScopeIdLoop: | 5720 | case ScopeIdLoop: |
| 5718 | case ScopeIdRuntime: | 5721 | case ScopeIdRuntime: |
| 5719 | continue; | 5722 | continue; |
| 5720 | case ScopeIdExpr: { | 5723 | case ScopeIdExpr: { |
| | 5724 | if (!looking_for_exprs) { |
| | 5725 | // Now we're only looking for a block, to see if it's in a loop (see the case ScopeIdBlock) |
| | 5726 | continue; |
| | 5727 | } |
| 5721 | ScopeExpr *parent_expr_scope = reinterpret_cast<ScopeExpr *>(scope); | 5728 | ScopeExpr *parent_expr_scope = reinterpret_cast<ScopeExpr *>(scope); |
| 5722 | if (child_expr_scope != nullptr) { | 5729 | if (child_expr_scope != nullptr) { |
| 5723 | for (size_t i = 0; parent_expr_scope->children_ptr[i] != child_expr_scope; i += 1) { | 5730 | for (size_t i = 0; parent_expr_scope->children_ptr[i] != child_expr_scope; i += 1) { |