aboutsummaryrefslogtreecommitdiff
path: root/lfunc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-02-05 11:00:28 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-02-05 11:00:28 -0300
commit2bfa13e520e53210b96ead88f49a9ca20c5a5d18 (patch)
treeef9c505f3ef9f6008d0bf993f2ed03fa04faac0e /lfunc.c
parente500892e18e994781760819e33098322728796e8 (diff)
downloadlua-2bfa13e520e53210b96ead88f49a9ca20c5a5d18.tar.gz
lua-2bfa13e520e53210b96ead88f49a9ca20c5a5d18.tar.bz2
lua-2bfa13e520e53210b96ead88f49a9ca20c5a5d18.zip
Fixed some bugs around stack reallocation
Long time without using HARDSTACKTESTS...
Diffstat (limited to 'lfunc.c')
-rw-r--r--lfunc.c2
1 files changed, 2 insertions, 0 deletions
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) {
190 UpVal *uv; 190 UpVal *uv;
191 StkId upl; /* stack index pointed by 'uv' */ 191 StkId upl; /* stack index pointed by 'uv' */
192 if (unlikely(status == LUA_ERRMEM && L->ptbc != NULL)) { 192 if (unlikely(status == LUA_ERRMEM && L->ptbc != NULL)) {
193 ptrdiff_t levelrel = savestack(L, level);
193 upl = L->ptbc; 194 upl = L->ptbc;
194 L->ptbc = NULL; /* remove from "list" before closing */ 195 L->ptbc = NULL; /* remove from "list" before closing */
195 prepcallclosemth(L, upl, status, yy); 196 prepcallclosemth(L, upl, status, yy);
197 level = restorestack(L, levelrel);
196 } 198 }
197 else 199 else
198 lua_assert(L->ptbc == NULL); /* must be empty for other status */ 200 lua_assert(L->ptbc == NULL); /* must be empty for other status */