Prevent compile of __concat with tailcall to fast function.

E.g. __concat = function() return setmetatable(...) end
Reported by Fezile Manana.
This commit is contained in:
Mike Pall 2021-04-21 15:23:15 +02:00
parent de77205490
commit 75ee3a6159

View 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)