aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2015-10-24 17:59:44 +0200
committerMike Pall <mike>2015-10-24 17:59:44 +0200
commite5f4cb1ccb3bfef5d40a2329d6aa36c1ba74a709 (patch)
treebbd66a179f53453892de11885e3b2fb1127bc1b2 /src
parent4808e62a9a05fef36854a05e09f791148de1ad74 (diff)
downloadluajit-e5f4cb1ccb3bfef5d40a2329d6aa36c1ba74a709.tar.gz
luajit-e5f4cb1ccb3bfef5d40a2329d6aa36c1ba74a709.tar.bz2
luajit-e5f4cb1ccb3bfef5d40a2329d6aa36c1ba74a709.zip
FFI: Fix ipairs() recording.
Thanks to Vyacheslav Egorov.
Diffstat (limited to 'src')
-rw-r--r--src/lj_ffrecord.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lj_ffrecord.c b/src/lj_ffrecord.c
index 69f71ab2..30832251 100644
--- a/src/lj_ffrecord.c
+++ b/src/lj_ffrecord.c
@@ -366,11 +366,12 @@ static void LJ_FASTCALL recff_ipairs_aux(jit_State *J, RecordFFData *rd)
366 366
367static void LJ_FASTCALL recff_ipairs(jit_State *J, RecordFFData *rd) 367static void LJ_FASTCALL recff_ipairs(jit_State *J, RecordFFData *rd)
368{ 368{
369 if (!(LJ_52 && recff_metacall(J, rd, MM_ipairs))) { 369 TRef tr = J->base[0];
370 TRef tab = J->base[0]; 370 if (!((LJ_52 || (LJ_HASFFI && tref_iscdata(tr))) &&
371 if (tref_istab(tab)) { 371 recff_metacall(J, rd, MM_ipairs))) {
372 if (tref_istab(tr)) {
372 J->base[0] = lj_ir_kfunc(J, funcV(&J->fn->c.upvalue[0])); 373 J->base[0] = lj_ir_kfunc(J, funcV(&J->fn->c.upvalue[0]));
373 J->base[1] = tab; 374 J->base[1] = tr;
374 J->base[2] = lj_ir_kint(J, 0); 375 J->base[2] = lj_ir_kint(J, 0);
375 rd->nres = 3; 376 rd->nres = 3;
376 } /* else: Interpreter will throw. */ 377 } /* else: Interpreter will throw. */