From fc5d47b9b960aa08d65bf0dfe3d6395c811f793b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 16 Feb 2017 15:45:41 -0500 Subject: reading from a bit field partially works See #261 Still need to do: * reading a field that has bit offset 0 but still needs to shift and truncate * writing a field --- src/ir.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 03b77a69f7..ddb2164ad5 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -9067,7 +9067,8 @@ static TypeTableEntry *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field } } ir_build_struct_field_ptr_from(&ira->new_irb, &field_ptr_instruction->base, container_ptr, field); - return get_pointer_to_type_extra(ira->codegen, field->type_entry, is_const, 0, is_volatile); + return get_pointer_to_type_extra(ira->codegen, field->type_entry, is_const, + field->packed_bits_offset, is_volatile); } else { return ir_analyze_container_member_access_inner(ira, bare_type, field_name, field_ptr_instruction, container_ptr, container_type); -- cgit v1.2.3