| ... | @@ -4113,6 +4113,8 @@ static LLVMValueRef ir_render_call(CodeGen *g, IrExecutable *executable, IrInstr | ... | @@ -4113,6 +4113,8 @@ static LLVMValueRef ir_render_call(CodeGen *g, IrExecutable *executable, IrInstr |
| 4113 | static LLVMValueRef ir_render_struct_field_ptr(CodeGen *g, IrExecutable *executable, | 4113 | static LLVMValueRef ir_render_struct_field_ptr(CodeGen *g, IrExecutable *executable, |
| 4114 | IrInstructionStructFieldPtr *instruction) | 4114 | IrInstructionStructFieldPtr *instruction) |
| 4115 | { | 4115 | { |
| | 4116 | Error err; |
| | 4117 | |
| 4116 | if (instruction->base.value.special != ConstValSpecialRuntime) | 4118 | if (instruction->base.value.special != ConstValSpecialRuntime) |
| 4117 | return nullptr; | 4119 | return nullptr; |
| 4118 | | 4120 | |
| ... | @@ -4130,6 +4132,11 @@ static LLVMValueRef ir_render_struct_field_ptr(CodeGen *g, IrExecutable *executa | ... | @@ -4130,6 +4132,11 @@ static LLVMValueRef ir_render_struct_field_ptr(CodeGen *g, IrExecutable *executa |
| 4130 | return struct_ptr; | 4132 | return struct_ptr; |
| 4131 | } | 4133 | } |
| 4132 | | 4134 | |
| | 4135 | ZigType *struct_type = (struct_ptr_type->id == ZigTypeIdPointer) ? |
| | 4136 | struct_ptr_type->data.pointer.child_type : struct_ptr_type; |
| | 4137 | if ((err = type_resolve(g, struct_type, ResolveStatusLLVMFull))) |
| | 4138 | report_errors_and_exit(g); |
| | 4139 | |
| 4133 | assert(field->gen_index != SIZE_MAX); | 4140 | assert(field->gen_index != SIZE_MAX); |
| 4134 | return LLVMBuildStructGEP(g->builder, struct_ptr, (unsigned)field->gen_index, ""); | 4141 | return LLVMBuildStructGEP(g->builder, struct_ptr, (unsigned)field->gen_index, ""); |
| 4135 | } | 4142 | } |