| ... | ... | @@ -1446,8 +1446,6 @@ static IrInstruction *ir_build_var_decl(IrBuilder *irb, Scope *scope, AstNode *s |
| 1446 | 1446 | if (align_value) ir_ref_instruction(align_value, irb->current_basic_block); |
| 1447 | 1447 | ir_ref_instruction(init_value, irb->current_basic_block); |
| 1448 | 1448 | |
| 1449 | | var->decl_instruction = &decl_var_instruction->base; |
| 1450 | | |
| 1451 | 1449 | return &decl_var_instruction->base; |
| 1452 | 1450 | } |
| 1453 | 1451 | |
| ... | ... | @@ -12433,8 +12431,6 @@ static TypeTableEntry *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstruc |
| 12433 | 12431 | return var->value->type; |
| 12434 | 12432 | } |
| 12435 | 12433 | |
| 12436 | | var->ref_count = 0; |
| 12437 | | |
| 12438 | 12434 | TypeTableEntry *explicit_type = nullptr; |
| 12439 | 12435 | IrInstruction *var_type = nullptr; |
| 12440 | 12436 | if (decl_var_instruction->var_type != nullptr) { |
| ... | ... | @@ -12503,6 +12499,7 @@ static TypeTableEntry *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstruc |
| 12503 | 12499 | VariableTableEntry *new_var = create_local_var(ira->codegen, var->decl_node, var->child_scope, |
| 12504 | 12500 | &var->name, var->src_is_const, var->gen_is_const, var->shadowable, var->is_comptime, true); |
| 12505 | 12501 | new_var->owner_exec = var->owner_exec; |
| 12502 | new_var->align_bytes = var->align_bytes; |
| 12506 | 12503 | if (var->mem_slot_index != SIZE_MAX) { |
| 12507 | 12504 | ConstExprValue *vals = create_const_vals(1); |
| 12508 | 12505 | new_var->mem_slot_index = ira->exec_context.mem_slot_list.length; |
| ... | ... | @@ -12513,6 +12510,9 @@ static TypeTableEntry *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstruc |
| 12513 | 12510 | var = new_var; |
| 12514 | 12511 | } |
| 12515 | 12512 | |
| 12513 | // This must be done after possibly creating a new variable above |
| 12514 | var->ref_count = 0; |
| 12515 | |
| 12516 | 12516 | var->value->type = result_type; |
| 12517 | 12517 | assert(var->value->type); |
| 12518 | 12518 | |