mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-05 17:30:27 +00:00
Update redbean Lua to check there is enough stack to use
This commit is contained in:
parent
b420ed8248
commit
6cb8e241f7
1 changed files with 2 additions and 0 deletions
|
@ -1080,6 +1080,8 @@ static int LuaCallWithTrace(lua_State *L, int nargs, int nres) {
|
|||
} else {
|
||||
// move results to the main stack
|
||||
lua_xmove(co, L, nresults);
|
||||
// make sure the stack has enough space to grow
|
||||
luaL_checkstack(L, nres - nresults, NULL);
|
||||
// grow the stack in case returned fewer results
|
||||
// than the caller expects, as lua_resume
|
||||
// doesn't adjust the stack for needed results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue