]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Merge branch 'master' into v2.1
authorMike Pall <mike>
Sat, 24 Oct 2015 16:03:55 +0000 (18:03 +0200)
committerMike Pall <mike>
Sat, 24 Oct 2015 16:03:55 +0000 (18:03 +0200)
1  2 
src/lj_ffrecord.c

index 6cc05a24f782d7aed0822bc5b2c9eb466e1f5561,308322517c5ced1ed4d553518e230f3835bd8741..09db2454e265e1db53cd0c74f77b3a257bb393b6
@@@ -433,14 -364,15 +433,15 @@@ static void LJ_FASTCALL recff_ipairs_au
    }  /* else: Interpreter will throw. */
  }
  
 -static void LJ_FASTCALL recff_ipairs(jit_State *J, RecordFFData *rd)
 +static void LJ_FASTCALL recff_xpairs(jit_State *J, RecordFFData *rd)
  {
-   if (!(LJ_52 && recff_metacall(J, rd, MM_ipairs))) {
-     TRef tab = J->base[0];
-     if (tref_istab(tab)) {
+   TRef tr = J->base[0];
+   if (!((LJ_52 || (LJ_HASFFI && tref_iscdata(tr))) &&
+       recff_metacall(J, rd, MM_ipairs))) {
+     if (tref_istab(tr)) {
        J->base[0] = lj_ir_kfunc(J, funcV(&J->fn->c.upvalue[0]));
-       J->base[1] = tab;
+       J->base[1] = tr;
 -      J->base[2] = lj_ir_kint(J, 0);
 +      J->base[2] = rd->data ? lj_ir_kint(J, 0) : TREF_NIL;
        rd->nres = 3;
      }  /* else: Interpreter will throw. */
    }