]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix recording of select(n, ...) with off-trace varargs
authorMike Pall <mike>
Sun, 3 Apr 2016 17:12:28 +0000 (19:12 +0200)
committerMike Pall <mike>
Sun, 3 Apr 2016 17:12:28 +0000 (19:12 +0200)
Thanks to Peter Cawley.

src/lj_record.c

index 1bb9461eb4c762ea1ff7072b4e8d51664457326f..9b51c51f225bebb9f102428a84f69264656da210 100644 (file)
@@ -1490,8 +1490,11 @@ static int select_detect(jit_State *J)
   BCIns ins = J->pc[1];
   if (bc_op(ins) == BC_CALLM && bc_b(ins) == 2 && bc_c(ins) == 1) {
     cTValue *func = &J->L->base[bc_a(ins)];
-    if (tvisfunc(func) && funcV(func)->c.ffid == FF_select)
+    if (tvisfunc(func) && funcV(func)->c.ffid == FF_select) {
+      TRef kfunc = lj_ir_kfunc(J, funcV(func));
+      emitir(IRTG(IR_EQ, IRT_FUNC), getslot(J, bc_a(ins)), kfunc);
       return 1;
+    }
   }
   return 0;
 }