| ... | @@ -7845,7 +7845,7 @@ static IrInstruction *ir_gen_cancel(IrBuilder *irb, Scope *scope, AstNode *node) | ... | @@ -7845,7 +7845,7 @@ static IrInstruction *ir_gen_cancel(IrBuilder *irb, Scope *scope, AstNode *node) |
| 7845 | return irb->codegen->invalid_instruction; | 7845 | return irb->codegen->invalid_instruction; |
| 7846 | } | 7846 | } |
| 7847 | | 7847 | |
| 7848 | IrInstruction *operand = ir_gen_node(irb, node->data.cancel_expr.expr, scope); | 7848 | IrInstruction *operand = ir_gen_node_extra(irb, node->data.cancel_expr.expr, scope, LValPtr, nullptr); |
| 7849 | if (operand == irb->codegen->invalid_instruction) | 7849 | if (operand == irb->codegen->invalid_instruction) |
| 7850 | return irb->codegen->invalid_instruction; | 7850 | return irb->codegen->invalid_instruction; |
| 7851 | | 7851 | |
| ... | @@ -24496,10 +24496,20 @@ static IrInstruction *ir_analyze_instruction_suspend_finish(IrAnalyze *ira, | ... | @@ -24496,10 +24496,20 @@ static IrInstruction *ir_analyze_instruction_suspend_finish(IrAnalyze *ira, |
| 24496 | } | 24496 | } |
| 24497 | | 24497 | |
| 24498 | static IrInstruction *ir_analyze_instruction_cancel(IrAnalyze *ira, IrInstructionCancel *instruction) { | 24498 | static IrInstruction *ir_analyze_instruction_cancel(IrAnalyze *ira, IrInstructionCancel *instruction) { |
| 24499 | IrInstruction *frame = instruction->frame->child; | 24499 | IrInstruction *frame_ptr = instruction->frame->child; |
| 24500 | if (type_is_invalid(frame->value.type)) | 24500 | if (type_is_invalid(frame_ptr->value.type)) |
| 24501 | return ira->codegen->invalid_instruction; | 24501 | return ira->codegen->invalid_instruction; |
| 24502 | | 24502 | |
| | 24503 | IrInstruction *frame; |
| | 24504 | if (frame_ptr->value.type->id == ZigTypeIdPointer && |
| | 24505 | frame_ptr->value.type->data.pointer.ptr_len == PtrLenSingle && |
| | 24506 | frame_ptr->value.type->data.pointer.child_type->id == ZigTypeIdCoroFrame) |
| | 24507 | { |
| | 24508 | frame = frame_ptr; |
| | 24509 | } else { |
| | 24510 | frame = ir_get_deref(ira, &instruction->base, frame_ptr, nullptr); |
| | 24511 | } |
| | 24512 | |
| 24503 | ZigType *any_frame_type = get_any_frame_type(ira->codegen, nullptr); | 24513 | ZigType *any_frame_type = get_any_frame_type(ira->codegen, nullptr); |
| 24504 | IrInstruction *casted_frame = ir_implicit_cast(ira, frame, any_frame_type); | 24514 | IrInstruction *casted_frame = ir_implicit_cast(ira, frame, any_frame_type); |
| 24505 | if (type_is_invalid(casted_frame->value.type)) | 24515 | if (type_is_invalid(casted_frame->value.type)) |