diff options
author | Mike Pall <mike> | 2021-04-21 15:23:15 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2021-04-21 15:23:15 +0200 |
commit | 75ee3a6159f1831fa57992df3caf5a2c303c281a (patch) | |
tree | ac7831477822fe3ddae7d663673f7e9a4094604e /src | |
parent | de772054904054af077d6f448681810e8cc1520d (diff) | |
download | luajit-75ee3a6159f1831fa57992df3caf5a2c303c281a.tar.gz luajit-75ee3a6159f1831fa57992df3caf5a2c303c281a.tar.bz2 luajit-75ee3a6159f1831fa57992df3caf5a2c303c281a.zip |
Prevent compile of __concat with tailcall to fast function.
E.g. __concat = function() return setmetatable(...) end
Reported by Fezile Manana.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_record.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index 3ca2fb4f..86f17abc 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -919,6 +919,9 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults) | |||
919 | TRef tr = gotresults ? J->base[cbase+rbase] : TREF_NIL; | 919 | TRef tr = gotresults ? J->base[cbase+rbase] : TREF_NIL; |
920 | if (bslot != J->maxslot) { /* Concatenate the remainder. */ | 920 | if (bslot != J->maxslot) { /* Concatenate the remainder. */ |
921 | TValue *b = J->L->base, save; /* Simulate lower frame and result. */ | 921 | TValue *b = J->L->base, save; /* Simulate lower frame and result. */ |
922 | /* Can't handle MM_concat + CALLT + fast func side-effects. */ | ||
923 | if (J->postproc != LJ_POST_NONE) | ||
924 | lj_trace_err(J, LJ_TRERR_NYIRETL); | ||
922 | J->base[J->maxslot] = tr; | 925 | J->base[J->maxslot] = tr; |
923 | copyTV(J->L, &save, b-(2<<LJ_FR2)); | 926 | copyTV(J->L, &save, b-(2<<LJ_FR2)); |
924 | if (gotresults) | 927 | if (gotresults) |