summaryrefslogtreecommitdiff
path: root/src/lib_jit.c
diff options
context:
space:
mode:
authorMike Pall <mike>2009-12-29 01:38:26 +0100
committerMike Pall <mike>2009-12-29 01:38:26 +0100
commit374f53471528e1592d9075c47e579d2f3c546beb (patch)
tree46fabaa61de90e0bf232de21ab70370eb61af6c1 /src/lib_jit.c
parent8a9cfa4b4592e50be1903b83d28c8ea2fbc4aa43 (diff)
downloadluajit-374f53471528e1592d9075c47e579d2f3c546beb.tar.gz
luajit-374f53471528e1592d9075c47e579d2f3c546beb.tar.bz2
luajit-374f53471528e1592d9075c47e579d2f3c546beb.zip
Logical 'not' must be sign-extended for address operands.
Diffstat (limited to 'src/lib_jit.c')
-rw-r--r--src/lib_jit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib_jit.c b/src/lib_jit.c
index 0352fbe5..dceb9e5c 100644
--- a/src/lib_jit.c
+++ b/src/lib_jit.c
@@ -224,14 +224,14 @@ LJLIB_CF(jit_util_funcbc)
224LJLIB_CF(jit_util_funck) 224LJLIB_CF(jit_util_funck)
225{ 225{
226 GCproto *pt = check_Lproto(L, 0); 226 GCproto *pt = check_Lproto(L, 0);
227 MSize idx = (MSize)lj_lib_checkint(L, 2); 227 ptrdiff_t idx = (ptrdiff_t)lj_lib_checkint(L, 2);
228 if ((int32_t)idx >= 0) { 228 if (idx >= 0) {
229 if (idx < pt->sizekn) { 229 if (idx < (ptrdiff_t)pt->sizekn) {
230 setnumV(L->top-1, pt->k.n[idx]); 230 setnumV(L->top-1, pt->k.n[idx]);
231 return 1; 231 return 1;
232 } 232 }
233 } else { 233 } else {
234 if (~idx < pt->sizekgc) { 234 if (~idx < (ptrdiff_t)pt->sizekgc) {
235 GCobj *gc = gcref(pt->k.gc[idx]); 235 GCobj *gc = gcref(pt->k.gc[idx]);
236 setgcV(L, L->top-1, &gc->gch, ~gc->gch.gct); 236 setgcV(L, L->top-1, &gc->gch, ~gc->gch.gct);
237 return 1; 237 return 1;