diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-07-13 13:39:02 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-07-13 13:39:02 -0300 |
commit | e1d8770f12542d34a3e32b825c95b93f8a341ee1 (patch) | |
tree | 15296aaedd195efd19192052af2192fcd7c12f54 /ldo.c | |
parent | 0f1cd0eba99ea6d383e75b9ae488d00ad541c210 (diff) | |
download | lua-e1d8770f12542d34a3e32b825c95b93f8a341ee1.tar.gz lua-e1d8770f12542d34a3e32b825c95b93f8a341ee1.tar.bz2 lua-e1d8770f12542d34a3e32b825c95b93f8a341ee1.zip |
Fixed bug: wrong stack limit when entering a coroutine
When entering a coroutine, the computation of nCcalls added 'from->nci'
to correct for preallocated CallInfos, but 'nci' includes also the
Callinfos already used.
Diffstat (limited to '')
-rw-r--r-- | ldo.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -674,7 +674,7 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs, | |||
674 | if (from == NULL) | 674 | if (from == NULL) |
675 | L->nCcalls = CSTACKTHREAD; | 675 | L->nCcalls = CSTACKTHREAD; |
676 | else /* correct 'nCcalls' for this thread */ | 676 | else /* correct 'nCcalls' for this thread */ |
677 | L->nCcalls = getCcalls(from) + from->nci - L->nci - CSTACKCF; | 677 | L->nCcalls = getCcalls(from) - L->nci - CSTACKCF; |
678 | if (L->nCcalls <= CSTACKERR) | 678 | if (L->nCcalls <= CSTACKERR) |
679 | return resume_error(L, "C stack overflow", nargs); | 679 | return resume_error(L, "C stack overflow", nargs); |
680 | luai_userstateresume(L, nargs); | 680 | luai_userstateresume(L, nargs); |