]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Prevent compile of __concat with tailcall to fast function.
authorMike Pall <mike>
Wed, 21 Apr 2021 13:23:15 +0000 (15:23 +0200)
committerMike Pall <mike>
Wed, 21 Apr 2021 13:23:15 +0000 (15:23 +0200)
E.g. __concat = function() return setmetatable(...) end
Reported by Fezile Manana.

src/lj_record.c

index 3ca2fb4f1ecb9a402d2000839d9546724f341199..86f17abc845c95b471dcc6bf230266f02cedea62 100644 (file)
@@ -919,6 +919,9 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults)
       TRef tr = gotresults ? J->base[cbase+rbase] : TREF_NIL;
       if (bslot != J->maxslot) {  /* Concatenate the remainder. */
        TValue *b = J->L->base, save;  /* Simulate lower frame and result. */
+       /* Can't handle MM_concat + CALLT + fast func side-effects. */
+       if (J->postproc != LJ_POST_NONE)
+         lj_trace_err(J, LJ_TRERR_NYIRETL);
        J->base[J->maxslot] = tr;
        copyTV(J->L, &save, b-(2<<LJ_FR2));
        if (gotresults)