aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-12-29 15:01:56 +0000
committergingerBill <bill@gingerbill.org>2021-12-29 15:01:56 +0000
commited742846cb6447d9d9ff6a4cfde285d7f4bb0eb9 (patch)
tree1dff114935127038419b8103bc121db719a04191
parented8b20da787edd3747cc85708a0b9dd2c2e256d1 (diff)
Correct `lb_emit_ptr_offset` bug caused by `LLVMConstGEP` assuming a signed index
-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 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;