]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI: Fix recording of pointer arithmetic.
authorMike Pall <mike>
Mon, 7 Feb 2011 22:42:51 +0000 (23:42 +0100)
committerMike Pall <mike>
Mon, 7 Feb 2011 22:42:51 +0000 (23:42 +0100)
src/lj_crecord.c

index 44c5844a144ba3de1b8a66a35df2e75cdb87aed0..ea18f75fa5ac74d4513c9dc40d0b26fbdbc8317e 100644 (file)
@@ -841,7 +841,7 @@ static TRef crec_arith_ptr(jit_State *J, TRef *sp, CType **s, MMS mm)
     }
 #endif
     tr = emitir(IRT(IR_MUL, IRT_INTP), tr, lj_ir_kintp(J, sz));
-    tr = emitir(IRT(IR_ADD, IRT_PTR), sp[0], tr);
+    tr = emitir(IRT(mm+(int)IR_ADD-(int)MM_add, IRT_PTR), sp[0], tr);
     id = lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|ctype_cid(ctp->info)),
                         CTSIZE_PTR);
     return emitir(IRTG(IR_CNEWI, IRT_CDATA), lj_ir_kint(J, id), tr);