| ... | @@ -8212,10 +8212,9 @@ static IrInstruction *ir_get_var_ptr(IrAnalyze *ira, IrInstruction *instruction, | ... | @@ -8212,10 +8212,9 @@ static IrInstruction *ir_get_var_ptr(IrAnalyze *ira, IrInstruction *instruction, |
| 8212 | bool comptime_var_mem = ir_get_var_is_comptime(var); | 8212 | bool comptime_var_mem = ir_get_var_is_comptime(var); |
| 8213 | | 8213 | |
| 8214 | ConstExprValue *mem_slot = nullptr; | 8214 | ConstExprValue *mem_slot = nullptr; |
| 8215 | FnTableEntry *fn_entry = scope_fn_entry(var->parent_scope); | | |
| 8216 | if (var->value->special == ConstValSpecialStatic) { | 8215 | if (var->value->special == ConstValSpecialStatic) { |
| 8217 | mem_slot = var->value; | 8216 | mem_slot = var->value; |
| 8218 | } else if (fn_entry) { | 8217 | } else { |
| 8219 | // TODO once the analyze code is fully ported over to IR we won't need this SIZE_MAX thing. | 8218 | // TODO once the analyze code is fully ported over to IR we won't need this SIZE_MAX thing. |
| 8220 | if (var->mem_slot_index != SIZE_MAX && (comptime_var_mem || var->gen_is_const)) | 8219 | if (var->mem_slot_index != SIZE_MAX && (comptime_var_mem || var->gen_is_const)) |
| 8221 | mem_slot = &ira->exec_context.mem_slot_list[var->mem_slot_index]; | 8220 | mem_slot = &ira->exec_context.mem_slot_list[var->mem_slot_index]; |