From ed742846cb6447d9d9ff6a4cfde285d7f4bb0eb9 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 29 Dec 2021 15:01:56 +0000 Subject: [PATCH] Correct `lb_emit_ptr_offset` bug caused by `LLVMConstGEP` assuming a signed index --- src/llvm_backend_utility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llvm_backend_utility.cpp b/src/llvm_backend_utility.cpp index 0350f7287..3fe96459f 100644 --- a/src/llvm_backend_utility.cpp +++ b/src/llvm_backend_utility.cpp @@ -1200,7 +1200,7 @@ lbValue lb_emit_array_epi(lbProcedure *p, lbValue s, isize index) { } lbValue lb_emit_ptr_offset(lbProcedure *p, lbValue ptr, lbValue index) { - index = lb_correct_endianness(p, index); + index = lb_emit_conv(p, index, t_int); LLVMValueRef indices[1] = {index.value}; lbValue res = {}; res.type = ptr.type;