Add stricter check for print() vs. tostring() shortcut.

master
Mike Pall 2019-12-08 19:40:24 +01:00
parent 16e5605eec
commit 46a1b268eb
1 changed files with 2 additions and 1 deletions

View File

@ -504,7 +504,8 @@ LJLIB_CF(print)
lua_gettable(L, LUA_GLOBALSINDEX);
tv = L->top-1;
}
shortcut = (tvisfunc(tv) && funcV(tv)->c.ffid == FF_tostring);
shortcut = (tvisfunc(tv) && funcV(tv)->c.ffid == FF_tostring)
&& !gcrefu(basemt_it(G(L), LJ_TNUMX));
for (i = 0; i < nargs; i++) {
const char *str;
size_t size;