diff options
Diffstat (limited to 'src/stage1/ir.cpp')
| -rw-r--r-- | src/stage1/ir.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/stage1/ir.cpp b/src/stage1/ir.cpp index 62c52c8a97..dc74fb9c14 100644 --- a/src/stage1/ir.cpp +++ b/src/stage1/ir.cpp @@ -22188,6 +22188,8 @@ static IrInstGen *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstSrcElemP } return result; } else if (is_slice(array_type)) { + expand_undef_struct(ira->codegen, array_ptr_val); + ZigValue *ptr_field = array_ptr_val->data.x_struct.fields[slice_ptr_index]; ir_assert(ptr_field != nullptr, &elem_ptr_instruction->base.base); if (ptr_field->data.x_ptr.special == ConstPtrSpecialHardCodedAddr) { @@ -22252,6 +22254,8 @@ static IrInstGen *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstSrcElemP } return result; } else if (array_type->id == ZigTypeIdArray || array_type->id == ZigTypeIdVector) { + expand_undef_array(ira->codegen, array_ptr_val); + IrInstGen *result; if (orig_array_ptr_val->data.x_ptr.mut == ConstPtrMutInfer) { result = ir_build_elem_ptr_gen(ira, elem_ptr_instruction->base.base.scope, |
