Correct lb_emit_ptr_offset bug caused by LLVMConstGEP assuming a signed index
This commit is contained in:
1 parent
ed8b20da78
commit
ed742846cb
1 file changed
+1
-1
@@ -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) {
|
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};
|
LLVMValueRef indices[1] = {index.value};
|
||||||
lbValue res = {};
|
lbValue res = {};
|
||||||
res.type = ptr.type;
|
res.type = ptr.type;
|
||||||
|
|||||||
Reference in new issue
Block a user