diff options
| author | Jimmi HC <jimmiholstchristensen@gmail.com> | 2019-01-06 17:48:31 +0100 |
|---|---|---|
| committer | Jimmi HC <jimmiholstchristensen@gmail.com> | 2019-01-06 17:48:31 +0100 |
| commit | db928915878c64f9e5c479739bd768bd4ac0b912 (patch) | |
| tree | 1879972524543af67f8ee7044f9eafd8c31dea35 /src | |
| parent | 5f26d1dddbe9004429adca6e55d3344ca58062ae (diff) | |
| download | zig-db928915878c64f9e5c479739bd768bd4ac0b912.tar.gz zig-db928915878c64f9e5c479739bd768bd4ac0b912.zip | |
Respect the type system instead of ConstExprValue when getting field
Diffstat (limited to 'src')
| -rw-r--r-- | src/ir.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 400b07368b..d74bef2424 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -14577,8 +14577,7 @@ static IrInstruction *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_ return ira->codegen->invalid_instruction; if (type_is_invalid(struct_val->type)) return ira->codegen->invalid_instruction; - ConstExprValue *field_val = &struct_val->data.x_struct.fields[field->src_index]; - ZigType *ptr_type = get_pointer_to_type_extra(ira->codegen, field_val->type, + ZigType *ptr_type = get_pointer_to_type_extra(ira->codegen, field->type_entry, is_const, is_volatile, PtrLenSingle, align_bytes, (uint32_t)(ptr_bit_offset + field->bit_offset_in_host), (uint32_t)host_int_bytes_for_result_type); |
