From 8e7c7eeebabcf81e6ca06e44ae8b98554addd142 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 12 Aug 2022 13:48:10 +0100 Subject: Fix `lb_emit_ptr_offset` --- src/llvm_backend_utility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/llvm_backend_utility.cpp') diff --git a/src/llvm_backend_utility.cpp b/src/llvm_backend_utility.cpp index ce7b43321..35e69a1be 100644 --- a/src/llvm_backend_utility.cpp +++ b/src/llvm_backend_utility.cpp @@ -1285,7 +1285,7 @@ lbValue lb_emit_ptr_offset(lbProcedure *p, lbValue ptr, lbValue index) { LLVMValueRef indices[1] = {index.value}; lbValue res = {}; res.type = ptr.type; - LLVMTypeRef type = lb_type(p->module, type_deref(ptr.type)); + LLVMTypeRef type = lb_type(p->module, type_deref(res.type, true)); if (lb_is_const(ptr) && lb_is_const(index)) { res.value = LLVMConstGEP2(type, ptr.value, indices, 1); -- cgit v1.2.3