| ... | @@ -246,6 +246,8 @@ static void ir_ref_bb(IrBasicBlock *bb) { | ... | @@ -246,6 +246,8 @@ static void ir_ref_bb(IrBasicBlock *bb) { |
| 246 | static void ir_ref_instruction(IrInstruction *instruction, IrBasicBlock *cur_bb) { | 246 | static void ir_ref_instruction(IrInstruction *instruction, IrBasicBlock *cur_bb) { |
| 247 | assert(instruction->id != IrInstructionIdInvalid); | 247 | assert(instruction->id != IrInstructionIdInvalid); |
| 248 | instruction->ref_count += 1; | 248 | instruction->ref_count += 1; |
| | 249 | if (instruction->owner_bb != cur_bb && !instr_is_comptime(instruction)) |
| | 250 | ir_ref_bb(instruction->owner_bb); |
| 249 | } | 251 | } |
| 250 | | 252 | |
| 251 | static void ir_ref_var(VariableTableEntry *var) { | 253 | static void ir_ref_var(VariableTableEntry *var) { |