diff options
-rw-r--r-- | ldo.c | 7 | ||||
-rw-r--r-- | lstate.h | 11 |
2 files changed, 8 insertions, 10 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 2.118 2014/06/10 17:41:38 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.119 2014/06/10 18:51:21 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 | */ |
@@ -425,10 +425,10 @@ static void finishCcall (lua_State *L, int status) { | |||
425 | ci->callstatus &= ~CIST_YPCALL; /* finish 'lua_pcall' */ | 425 | ci->callstatus &= ~CIST_YPCALL; /* finish 'lua_pcall' */ |
426 | L->errfunc = ci->u.c.old_errfunc; | 426 | L->errfunc = ci->u.c.old_errfunc; |
427 | } | 427 | } |
428 | /* finish 'lua_callk'/'lua_pcall' */ | 428 | /* finish 'lua_callk'/'lua_pcall'; CIST_YPCALL and 'errfunc' already |
429 | handled */ | ||
429 | adjustresults(L, ci->nresults); | 430 | adjustresults(L, ci->nresults); |
430 | /* call continuation function */ | 431 | /* call continuation function */ |
431 | ci->callstatus = (ci->callstatus & ~CIST_YPCALL) | CIST_YIELDED; | ||
432 | lua_unlock(L); | 432 | lua_unlock(L); |
433 | n = (*ci->u.c.k)(L, status, ci->u.c.ctx); | 433 | n = (*ci->u.c.k)(L, status, ci->u.c.ctx); |
434 | lua_lock(L); | 434 | lua_lock(L); |
@@ -536,7 +536,6 @@ static void resume (lua_State *L, void *ud) { | |||
536 | else { /* 'common' yield */ | 536 | else { /* 'common' yield */ |
537 | if (ci->u.c.k != NULL) { /* does it have a continuation? */ | 537 | if (ci->u.c.k != NULL) { /* does it have a continuation? */ |
538 | int n; | 538 | int n; |
539 | ci->callstatus |= CIST_YIELDED; | ||
540 | lua_unlock(L); | 539 | lua_unlock(L); |
541 | n = (*ci->u.c.k)(L, LUA_YIELD, ci->u.c.ctx); /* call continuation */ | 540 | n = (*ci->u.c.k)(L, LUA_YIELD, ci->u.c.ctx); /* call continuation */ |
542 | lua_lock(L); | 541 | lua_lock(L); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.h,v 2.104 2014/06/10 17:41:38 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 2.105 2014/06/10 18:51:21 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -84,11 +84,10 @@ typedef struct CallInfo { | |||
84 | #define CIST_HOOKED (1<<1) /* call is running a debug hook */ | 84 | #define CIST_HOOKED (1<<1) /* call is running a debug hook */ |
85 | #define CIST_REENTRY (1<<2) /* call is running on same invocation of | 85 | #define CIST_REENTRY (1<<2) /* call is running on same invocation of |
86 | luaV_execute of previous call */ | 86 | luaV_execute of previous call */ |
87 | #define CIST_YIELDED (1<<3) /* call reentered after suspension */ | 87 | #define CIST_YPCALL (1<<3) /* call is a yieldable protected call */ |
88 | #define CIST_YPCALL (1<<4) /* call is a yieldable protected call */ | 88 | #define CIST_TAIL (1<<4) /* call was tail called */ |
89 | #define CIST_TAIL (1<<5) /* call was tail called */ | 89 | #define CIST_HOOKYIELD (1<<5) /* last hook called yielded */ |
90 | #define CIST_HOOKYIELD (1<<6) /* last hook called yielded */ | 90 | #define CIST_OAH (1<<6) /* original value of 'allowhook' */ |
91 | #define CIST_OAH (1<<7) /* original value of 'allowhook' */ | ||
92 | 91 | ||
93 | 92 | ||
94 | #define isLua(ci) ((ci)->callstatus & CIST_LUA) | 93 | #define isLua(ci) ((ci)->callstatus & CIST_LUA) |