| ... | ... | @@ -17030,8 +17030,10 @@ static IrInstGen *ir_analyze_tuple_cat(IrAnalyze *ira, IrInst* source_instr, |
| 17030 | 17030 | continue; |
| 17031 | 17031 | } |
| 17032 | 17032 | IrInstGen *deref = ir_get_deref(ira, &elem_result_loc->base, elem_result_loc, nullptr); |
| 17033 | | elem_result_loc->value->special = ConstValSpecialRuntime; |
| 17034 | | ir_analyze_store_ptr(ira, &elem_result_loc->base, elem_result_loc, deref, false); |
| 17033 | if (!type_requires_comptime(ira->codegen, elem_result_loc->value->type->data.pointer.child_type)) { |
| 17034 | elem_result_loc->value->special = ConstValSpecialRuntime; |
| 17035 | } |
| 17036 | ir_analyze_store_ptr(ira, &elem_result_loc->base, elem_result_loc, deref, true); |
| 17035 | 17037 | } |
| 17036 | 17038 | } |
| 17037 | 17039 | IrInstGen *result = ir_get_deref(ira, source_instr, new_struct_ptr, nullptr); |
| ... | ... | @@ -18904,7 +18906,10 @@ static IrInstGen *ir_analyze_store_ptr(IrAnalyze *ira, IrInst* source_instr, |
| 18904 | 18906 | } |
| 18905 | 18907 | |
| 18906 | 18908 | if (ptr->value->type->data.pointer.is_const && !allow_write_through_const) { |
| 18907 | | ir_add_error(ira, source_instr, buf_sprintf("cannot assign to constant")); |
| 18909 | // @TODO |
| 18910 | fprintf(stderr, "store ptr\n"); |
| 18911 | ptr->src(); |
| 18912 | ir_add_error(ira, source_instr, buf_sprintf("cannot assign to constant [FOO]")); |
| 18908 | 18913 | return ira->codegen->invalid_inst_gen; |
| 18909 | 18914 | } |
| 18910 | 18915 | |
| ... | ... | @@ -23042,8 +23047,11 @@ static IrInstGen *ir_analyze_instruction_container_init_list(IrAnalyze *ira, |
| 23042 | 23047 | } |
| 23043 | 23048 | } |
| 23044 | 23049 | |
| 23050 | const_ptrs.deinit(); |
| 23051 | |
| 23045 | 23052 | IrInstGen *result = ir_get_deref(ira, &instruction->base.base, result_loc, nullptr); |
| 23046 | | if (instr_is_comptime(result)) |
| 23053 | // If the result is a tuple, we are allowed to use ConstValSpecialRuntime fields. |
| 23054 | if (instr_is_comptime(result) || is_tuple(container_type)) |
| 23047 | 23055 | return result; |
| 23048 | 23056 | |
| 23049 | 23057 | if (is_comptime) { |