From f602a6acd734c61254d7887665d4a53960b7958a Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 24 Jun 2026 10:38:21 +0100 Subject: [PATCH] Fix #6725 #6798 #4943 --- src/llvm_backend_expr.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/llvm_backend_expr.cpp b/src/llvm_backend_expr.cpp index e02f743ca..7eb32279e 100644 --- a/src/llvm_backend_expr.cpp +++ b/src/llvm_backend_expr.cpp @@ -6571,11 +6571,12 @@ gb_internal lbAddr lb_build_addr_internal(lbProcedure *p, Ast *expr) { } else { item = lb_emit_ptr_offset(p, lb_emit_load(p, arr), index); } + + // make sure it's ^T and not [^]T + item.type = alloc_type_multi_pointer_to_pointer(item.type); if (sub_sel.index.count > 0) { item = lb_emit_deep_field_gep(p, item, sub_sel); } - // make sure it's ^T and not [^]T - item.type = alloc_type_multi_pointer_to_pointer(item.type); return lb_addr(item); } else if (addr.kind == lbAddr_Swizzle) {