diff options
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 2.108.1.1 2013/04/12 18:48:47 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.108.1.2 2013/04/19 21:03:23 roberto Exp roberto $ |
3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -534,6 +534,7 @@ static void resume (lua_State *L, void *ud) { | |||
534 | 534 | ||
535 | LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs) { | 535 | LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs) { |
536 | int status; | 536 | int status; |
537 | int oldnny = L->nny; /* save 'nny' */ | ||
537 | lua_lock(L); | 538 | lua_lock(L); |
538 | luai_userstateresume(L, nargs); | 539 | luai_userstateresume(L, nargs); |
539 | L->nCcalls = (from) ? from->nCcalls + 1 : 1; | 540 | L->nCcalls = (from) ? from->nCcalls + 1 : 1; |
@@ -555,7 +556,7 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs) { | |||
555 | } | 556 | } |
556 | lua_assert(status == L->status); | 557 | lua_assert(status == L->status); |
557 | } | 558 | } |
558 | L->nny = 1; /* do not allow yields */ | 559 | L->nny = oldnny; /* restore 'nny' */ |
559 | L->nCcalls--; | 560 | L->nCcalls--; |
560 | lua_assert(L->nCcalls == ((from) ? from->nCcalls : 0)); | 561 | lua_assert(L->nCcalls == ((from) ? from->nCcalls : 0)); |
561 | lua_unlock(L); | 562 | lua_unlock(L); |