mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
Handle stack reallocation in debug.setmetatable() and lua_setmetatable().
Thanks to Sergey Kaplun. #1172
This commit is contained in:
parent
defe61a567
commit
88ed9fdbbb
@ -975,6 +975,7 @@ LUA_API int lua_setmetatable(lua_State *L, int idx)
|
||||
/* Flush cache, since traces specialize to basemt. But not during __gc. */
|
||||
if (lj_trace_flushall(L))
|
||||
lj_err_caller(L, LJ_ERR_NOGCMM);
|
||||
o = index2adr(L, idx); /* Stack may have been reallocated. */
|
||||
if (tvisbool(o)) {
|
||||
/* NOBARRIER: basemt is a GC root. */
|
||||
setgcref(basemt_it(g, LJ_TTRUE), obj2gco(mt));
|
||||
|
Loading…
Reference in New Issue
Block a user