diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-02-05 11:00:28 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-02-05 11:00:28 -0300 |
commit | 2bfa13e520e53210b96ead88f49a9ca20c5a5d18 (patch) | |
tree | ef9c505f3ef9f6008d0bf993f2ed03fa04faac0e /lfunc.c | |
parent | e500892e18e994781760819e33098322728796e8 (diff) | |
download | lua-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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 */ |