From 2bfa13e520e53210b96ead88f49a9ca20c5a5d18 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 5 Feb 2021 11:00:28 -0300 Subject: Fixed some bugs around stack reallocation Long time without using HARDSTACKTESTS... --- lfunc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lfunc.c') diff --git a/lfunc.c b/lfunc.c index 81ac9f0a..105590fc 100644 --- a/lfunc.c +++ b/lfunc.c @@ -190,9 +190,11 @@ void luaF_close (lua_State *L, StkId level, int status, int yy) { UpVal *uv; StkId upl; /* stack index pointed by 'uv' */ if (unlikely(status == LUA_ERRMEM && L->ptbc != NULL)) { + ptrdiff_t levelrel = savestack(L, level); upl = L->ptbc; L->ptbc = NULL; /* remove from "list" before closing */ prepcallclosemth(L, upl, status, yy); + level = restorestack(L, levelrel); } else lua_assert(L->ptbc == NULL); /* must be empty for other status */ -- cgit v1.2.3-55-g6feb