diff options
| author | gingerBill <bill@gingerbill.org> | 2024-04-10 16:18:44 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-04-10 16:18:44 +0100 |
| commit | 13e459980b0143b49762cdfd04dd5cf1bbf83daa (patch) | |
| tree | 4ed2587a1e187861c3e9db3aa6e0e5c11b8fd689 /src/llvm_backend_expr.cpp | |
| parent | 3b5e515a22a4a8e284fc4891eeaf15f534916a7b (diff) | |
Fix `ptr_to_bit_field.field`
Diffstat (limited to 'src/llvm_backend_expr.cpp')
| -rw-r--r-- | src/llvm_backend_expr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/llvm_backend_expr.cpp b/src/llvm_backend_expr.cpp index 0649150ca..fcec59968 100644 --- a/src/llvm_backend_expr.cpp +++ b/src/llvm_backend_expr.cpp @@ -4726,9 +4726,12 @@ gb_internal lbAddr lb_build_addr_internal(lbProcedure *p, Ast *expr) { if (sub_sel.index.count > 0) { ptr = lb_emit_deep_field_gep(p, ptr, sub_sel); } + if (is_type_pointer(type_deref(ptr.type))) { + ptr = lb_emit_load(p, ptr); + } Type *bf_type = type_deref(ptr.type); - bf_type = base_type(type_deref(bf_type)); + bf_type = base_type(bf_type); GB_ASSERT(bf_type->kind == Type_BitField); i32 index = sel.index[sel.index.count-1]; |