| ... | ... | @@ -15482,6 +15482,13 @@ static IrInstruction *ir_analyze_store_ptr(IrAnalyze *ira, IrInstruction *source |
| 15482 | 15482 | return result; |
| 15483 | 15483 | } |
| 15484 | 15484 | |
| 15485 | static void mark_inferred_ptr_runtime(IrInstruction *ptr) { |
| 15486 | ir_assert(ptr->value.type->id == ZigTypeIdPointer, ptr); |
| 15487 | if (ptr->value.data.x_ptr.mut == ConstPtrMutInfer) { |
| 15488 | ptr->value.special = ConstValSpecialRuntime; |
| 15489 | } |
| 15490 | } |
| 15491 | |
| 15485 | 15492 | static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *call_instruction, |
| 15486 | 15493 | ZigFn *fn_entry, ZigType *fn_type, IrInstruction *fn_ref, |
| 15487 | 15494 | IrInstruction *first_arg_ptr, bool comptime_fn_call, FnInline fn_inline) |
| ... | ... | @@ -15926,7 +15933,7 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c |
| 15926 | 15933 | if (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)) { |
| 15927 | 15934 | return result_loc; |
| 15928 | 15935 | } |
| 15929 | | call_instruction->result_loc->written = true; |
| 15936 | mark_inferred_ptr_runtime(result_loc); |
| 15930 | 15937 | } else { |
| 15931 | 15938 | result_loc = nullptr; |
| 15932 | 15939 | } |
| ... | ... | @@ -16047,7 +16054,7 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c |
| 16047 | 16054 | if (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)) { |
| 16048 | 16055 | return result_loc; |
| 16049 | 16056 | } |
| 16050 | | call_instruction->result_loc->written = true; |
| 16057 | mark_inferred_ptr_runtime(result_loc); |
| 16051 | 16058 | } else { |
| 16052 | 16059 | result_loc = nullptr; |
| 16053 | 16060 | } |
| ... | ... | @@ -24820,9 +24827,6 @@ ZigType *ir_analyze(CodeGen *codegen, IrExecutable *old_exec, IrExecutable *new_ |
| 24820 | 24827 | continue; |
| 24821 | 24828 | } |
| 24822 | 24829 | |
| 24823 | | if (ira->codegen->verbose_ir) { |
| 24824 | | fprintf(stderr, "analyze #%zu\n", old_instruction->debug_id); |
| 24825 | | } |
| 24826 | 24830 | IrInstruction *new_instruction = ir_analyze_instruction_base(ira, old_instruction); |
| 24827 | 24831 | if (new_instruction != nullptr) { |
| 24828 | 24832 | ir_assert(new_instruction->value.type != nullptr || new_instruction->value.type != nullptr, old_instruction); |