| ... | @@ -18505,6 +18505,7 @@ static IrInstGen *ir_resolve_result_raw(IrAnalyze *ira, IrInst *suspend_source_i | ... | @@ -18505,6 +18505,7 @@ static IrInstGen *ir_resolve_result_raw(IrAnalyze *ira, IrInst *suspend_source_i |
| 18505 | return bitcasted_value; | 18505 | return bitcasted_value; |
| 18506 | } | 18506 | } |
| 18507 | | 18507 | |
| | 18508 | bool parent_was_written = result_bit_cast->parent->written; |
| 18508 | IrInstGen *parent_result_loc = ir_resolve_result(ira, suspend_source_instr, result_bit_cast->parent, | 18509 | IrInstGen *parent_result_loc = ir_resolve_result(ira, suspend_source_instr, result_bit_cast->parent, |
| 18509 | dest_type, bitcasted_value, force_runtime, true); | 18510 | dest_type, bitcasted_value, force_runtime, true); |
| 18510 | if (parent_result_loc == nullptr || type_is_invalid(parent_result_loc->value->type) || | 18511 | if (parent_result_loc == nullptr || type_is_invalid(parent_result_loc->value->type) || |
| ... | @@ -18521,13 +18522,24 @@ static IrInstGen *ir_resolve_result_raw(IrAnalyze *ira, IrInst *suspend_source_i | ... | @@ -18521,13 +18522,24 @@ static IrInstGen *ir_resolve_result_raw(IrAnalyze *ira, IrInst *suspend_source_i |
| 18521 | return parent_result_loc; | 18522 | return parent_result_loc; |
| 18522 | } | 18523 | } |
| 18523 | | 18524 | |
| 18524 | if ((err = type_resolve(ira->codegen, child_type, ResolveStatusAlignmentKnown))) { | 18525 | if ((err = type_resolve(ira->codegen, child_type, ResolveStatusSizeKnown))) { |
| 18525 | return ira->codegen->invalid_inst_gen; | 18526 | return ira->codegen->invalid_inst_gen; |
| 18526 | } | 18527 | } |
| 18527 | | 18528 | |
| 18528 | if ((err = type_resolve(ira->codegen, value_type, ResolveStatusAlignmentKnown))) { | 18529 | if ((err = type_resolve(ira->codegen, value_type, ResolveStatusSizeKnown))) { |
| 18529 | return ira->codegen->invalid_inst_gen; | 18530 | return ira->codegen->invalid_inst_gen; |
| 18530 | } | 18531 | } |
| | 18532 | |
| | 18533 | if (child_type != ira->codegen->builtin_types.entry_var) { |
| | 18534 | if (type_size(ira->codegen, child_type) != type_size(ira->codegen, value_type)) { |
| | 18535 | // pointer cast won't work; we need a temporary location. |
| | 18536 | result_bit_cast->parent->written = parent_was_written; |
| | 18537 | result_loc->written = true; |
| | 18538 | result_loc->resolved_loc = ir_resolve_result(ira, suspend_source_instr, no_result_loc(), |
| | 18539 | value_type, bitcasted_value, force_runtime, true); |
| | 18540 | return result_loc->resolved_loc; |
| | 18541 | } |
| | 18542 | } |
| 18531 | uint64_t parent_ptr_align = 0; | 18543 | uint64_t parent_ptr_align = 0; |
| 18532 | if (type_has_bits(value_type)) parent_ptr_align = get_ptr_align(ira->codegen, parent_ptr_type); | 18544 | if (type_has_bits(value_type)) parent_ptr_align = get_ptr_align(ira->codegen, parent_ptr_type); |
| 18533 | ZigType *ptr_type = get_pointer_to_type_extra(ira->codegen, value_type, | 18545 | ZigType *ptr_type = get_pointer_to_type_extra(ira->codegen, value_type, |