Fixed some bugs around stack reallocation

Long time without using HARDSTACKTESTS...
This commit is contained in:
Roberto Ierusalimschy
2021-02-05 11:00:28 -03:00
parent e500892e18
commit 2bfa13e520
4 changed files with 6 additions and 1 deletions

1
lapi.c
View File

@@ -207,6 +207,7 @@ LUA_API void lua_closeslot (lua_State *L, int idx) {
uplevel(L->openupval) == level,
"no variable to close at given level");
luaF_close(L, level, CLOSEKTOP, 0);
level = index2stack(L, idx); /* stack may be moved */
setnilvalue(s2v(level));
lua_unlock(L);
}