aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_utility.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-08-12 13:48:10 +0100
committergingerBill <bill@gingerbill.org>2022-08-12 13:48:10 +0100
commit8e7c7eeebabcf81e6ca06e44ae8b98554addd142 (patch)
treebd45472c32303fc778b84f6ec7c03e97327edcf1 /src/llvm_backend_utility.cpp
parent22d16c20f8e446fb51d7faa14f22b9f86df8b393 (diff)
Fix `lb_emit_ptr_offset`
Diffstat (limited to 'src/llvm_backend_utility.cpp')
-rw-r--r--src/llvm_backend_utility.cpp2
1 files changed, 1 insertions, 1 deletions
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);