| ... | ... | @@ -18413,7 +18413,7 @@ static IrInstGen *ir_resolve_result_raw(IrAnalyze *ira, IrInst *suspend_source_i |
| 18413 | 18413 | |
| 18414 | 18414 | IrInstGen *casted_value; |
| 18415 | 18415 | if (value != nullptr) { |
| 18416 | | casted_value = ir_implicit_cast(ira, value, dest_type); |
| 18416 | casted_value = ir_implicit_cast2(ira, suspend_source_instr, value, dest_type); |
| 18417 | 18417 | if (type_is_invalid(casted_value->value->type)) |
| 18418 | 18418 | return ira->codegen->invalid_inst_gen; |
| 18419 | 18419 | dest_type = casted_value->value->type; |
| ... | ... | @@ -18860,7 +18860,8 @@ static IrInstGen *ir_analyze_async_call(IrAnalyze *ira, IrInst* source_instr, Zi |
| 18860 | 18860 | if (type_is_invalid(result_loc->value->type) || result_loc->value->type->id == ZigTypeIdUnreachable) { |
| 18861 | 18861 | return result_loc; |
| 18862 | 18862 | } |
| 18863 | | result_loc = ir_implicit_cast(ira, result_loc, get_pointer_to_type(ira->codegen, frame_type, false)); |
| 18863 | result_loc = ir_implicit_cast2(ira, &call_result_loc->source_instruction->base, result_loc, |
| 18864 | get_pointer_to_type(ira->codegen, frame_type, false)); |
| 18864 | 18865 | if (type_is_invalid(result_loc->value->type)) |
| 18865 | 18866 | return ira->codegen->invalid_inst_gen; |
| 18866 | 18867 | return &ir_build_call_gen(ira, source_instr, fn_entry, fn_ref, arg_count, |
| ... | ... | @@ -19177,7 +19178,7 @@ static IrInstGen *ir_analyze_store_ptr(IrAnalyze *ira, IrInst* source_instr, |
| 19177 | 19178 | } |
| 19178 | 19179 | |
| 19179 | 19180 | static IrInstGen *analyze_casted_new_stack(IrAnalyze *ira, IrInst* source_instr, |
| 19180 | | IrInstGen *new_stack, bool is_async_call_builtin, ZigFn *fn_entry) |
| 19181 | IrInstGen *new_stack, IrInst *new_stack_src, bool is_async_call_builtin, ZigFn *fn_entry) |
| 19181 | 19182 | { |
| 19182 | 19183 | if (new_stack == nullptr) |
| 19183 | 19184 | return nullptr; |
| ... | ... | @@ -19202,14 +19203,14 @@ static IrInstGen *analyze_casted_new_stack(IrAnalyze *ira, IrInst* source_instr, |
| 19202 | 19203 | false, false, PtrLenUnknown, target_fn_align(ira->codegen->zig_target), 0, 0, false); |
| 19203 | 19204 | ZigType *u8_slice = get_slice_type(ira->codegen, u8_ptr); |
| 19204 | 19205 | ira->codegen->need_frame_size_prefix_data = true; |
| 19205 | | return ir_implicit_cast(ira, new_stack, u8_slice); |
| 19206 | return ir_implicit_cast2(ira, new_stack_src, new_stack, u8_slice); |
| 19206 | 19207 | } |
| 19207 | 19208 | } |
| 19208 | 19209 | |
| 19209 | 19210 | static IrInstGen *ir_analyze_fn_call(IrAnalyze *ira, IrInst* source_instr, |
| 19210 | 19211 | ZigFn *fn_entry, ZigType *fn_type, IrInstGen *fn_ref, |
| 19211 | 19212 | IrInstGen *first_arg_ptr, CallModifier modifier, |
| 19212 | | IrInstGen *new_stack, bool is_async_call_builtin, |
| 19213 | IrInstGen *new_stack, IrInst *new_stack_src, bool is_async_call_builtin, |
| 19213 | 19214 | IrInstGen **args_ptr, size_t args_len, IrInstGen *ret_ptr, ResultLoc *call_result_loc) |
| 19214 | 19215 | { |
| 19215 | 19216 | Error err; |
| ... | ... | @@ -19486,8 +19487,8 @@ static IrInstGen *ir_analyze_fn_call(IrAnalyze *ira, IrInst* source_instr, |
| 19486 | 19487 | case ReqCompTimeYes: |
| 19487 | 19488 | // Throw out our work and call the function as if it were comptime. |
| 19488 | 19489 | return ir_analyze_fn_call(ira, source_instr, fn_entry, fn_type, fn_ref, first_arg_ptr, |
| 19489 | | CallModifierCompileTime, new_stack, is_async_call_builtin, args_ptr, args_len, |
| 19490 | | ret_ptr, call_result_loc); |
| 19490 | CallModifierCompileTime, new_stack, new_stack_src, is_async_call_builtin, |
| 19491 | args_ptr, args_len, ret_ptr, call_result_loc); |
| 19491 | 19492 | case ReqCompTimeInvalid: |
| 19492 | 19493 | return ira->codegen->invalid_inst_gen; |
| 19493 | 19494 | case ReqCompTimeNo: |
| ... | ... | @@ -19522,7 +19523,7 @@ static IrInstGen *ir_analyze_fn_call(IrAnalyze *ira, IrInst* source_instr, |
| 19522 | 19523 | } |
| 19523 | 19524 | |
| 19524 | 19525 | IrInstGen *casted_new_stack = analyze_casted_new_stack(ira, source_instr, new_stack, |
| 19525 | | is_async_call_builtin, impl_fn); |
| 19526 | new_stack_src, is_async_call_builtin, impl_fn); |
| 19526 | 19527 | if (casted_new_stack != nullptr && type_is_invalid(casted_new_stack->value->type)) |
| 19527 | 19528 | return ira->codegen->invalid_inst_gen; |
| 19528 | 19529 | |
| ... | ... | @@ -19647,7 +19648,7 @@ static IrInstGen *ir_analyze_fn_call(IrAnalyze *ira, IrInst* source_instr, |
| 19647 | 19648 | return ira->codegen->invalid_inst_gen; |
| 19648 | 19649 | } |
| 19649 | 19650 | |
| 19650 | | IrInstGen *casted_new_stack = analyze_casted_new_stack(ira, source_instr, new_stack, |
| 19651 | IrInstGen *casted_new_stack = analyze_casted_new_stack(ira, source_instr, new_stack, new_stack_src, |
| 19651 | 19652 | is_async_call_builtin, fn_entry); |
| 19652 | 19653 | if (casted_new_stack != nullptr && type_is_invalid(casted_new_stack->value->type)) |
| 19653 | 19654 | return ira->codegen->invalid_inst_gen; |
| ... | ... | @@ -19706,10 +19707,12 @@ static IrInstGen *ir_analyze_fn_call_src(IrAnalyze *ira, IrInstSrcCall *call_ins |
| 19706 | 19707 | IrInstGen *first_arg_ptr, CallModifier modifier) |
| 19707 | 19708 | { |
| 19708 | 19709 | IrInstGen *new_stack = nullptr; |
| 19710 | IrInst *new_stack_src = nullptr; |
| 19709 | 19711 | if (call_instruction->new_stack) { |
| 19710 | 19712 | new_stack = call_instruction->new_stack->child; |
| 19711 | 19713 | if (type_is_invalid(new_stack->value->type)) |
| 19712 | 19714 | return ira->codegen->invalid_inst_gen; |
| 19715 | new_stack_src = &call_instruction->new_stack->base; |
| 19713 | 19716 | } |
| 19714 | 19717 | IrInstGen **args_ptr = allocate<IrInstGen *>(call_instruction->arg_count, "IrInstGen *"); |
| 19715 | 19718 | for (size_t i = 0; i < call_instruction->arg_count; i += 1) { |
| ... | ... | @@ -19724,7 +19727,7 @@ static IrInstGen *ir_analyze_fn_call_src(IrAnalyze *ira, IrInstSrcCall *call_ins |
| 19724 | 19727 | return ira->codegen->invalid_inst_gen; |
| 19725 | 19728 | } |
| 19726 | 19729 | IrInstGen *result = ir_analyze_fn_call(ira, &call_instruction->base.base, fn_entry, fn_type, fn_ref, |
| 19727 | | first_arg_ptr, modifier, new_stack, call_instruction->is_async_call_builtin, |
| 19730 | first_arg_ptr, modifier, new_stack, new_stack_src, call_instruction->is_async_call_builtin, |
| 19728 | 19731 | args_ptr, call_instruction->arg_count, ret_ptr, call_instruction->result_loc); |
| 19729 | 19732 | deallocate(args_ptr, call_instruction->arg_count, "IrInstGen *"); |
| 19730 | 19733 | return result; |
| ... | ... | @@ -19824,7 +19827,7 @@ static IrInstGen *ir_analyze_call_extra(IrAnalyze *ira, IrInst* source_instr, |
| 19824 | 19827 | } |
| 19825 | 19828 | |
| 19826 | 19829 | return ir_analyze_fn_call(ira, source_instr, fn, fn_type, fn_ref, first_arg_ptr, |
| 19827 | | modifier, stack, false, args_ptr, args_len, nullptr, result_loc); |
| 19830 | modifier, stack, &stack->base, false, args_ptr, args_len, nullptr, result_loc); |
| 19828 | 19831 | } |
| 19829 | 19832 | |
| 19830 | 19833 | static IrInstGen *ir_analyze_instruction_call_extra(IrAnalyze *ira, IrInstSrcCallExtra *instruction) { |
| ... | ... | @@ -29477,7 +29480,7 @@ static IrInstGen *ir_analyze_instruction_resume(IrAnalyze *ira, IrInstSrcResume |
| 29477 | 29480 | } |
| 29478 | 29481 | |
| 29479 | 29482 | ZigType *any_frame_type = get_any_frame_type(ira->codegen, nullptr); |
| 29480 | | IrInstGen *casted_frame = ir_implicit_cast(ira, frame, any_frame_type); |
| 29483 | IrInstGen *casted_frame = ir_implicit_cast2(ira, &instruction->frame->base, frame, any_frame_type); |
| 29481 | 29484 | if (type_is_invalid(casted_frame->value->type)) |
| 29482 | 29485 | return ira->codegen->invalid_inst_gen; |
| 29483 | 29486 | |