diff options
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/lua51/ldo.c')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua51/ldo.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lua51/ldo.c b/Build/source/texk/web2c/luatexdir/lua51/ldo.c index ab86fb70e8d..91144137788 100644 --- a/Build/source/texk/web2c/luatexdir/lua51/ldo.c +++ b/Build/source/texk/web2c/luatexdir/lua51/ldo.c @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 2.38 2006/06/05 19:36:14 roberto Exp $ +** $Id: ldo.c,v 2.38.1.3 2008/01/18 22:31:22 roberto Exp $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ @@ -332,7 +332,7 @@ static StkId callrethooks (lua_State *L, StkId firstResult) { ptrdiff_t fr = savestack(L, firstResult); /* next call may change stack */ luaD_callhook(L, LUA_HOOKRET, -1); if (f_isLua(L->ci)) { /* Lua function? */ - while (L->ci->tailcalls--) /* call hook for eventual tail calls */ + while ((L->hookmask & LUA_MASKRET) && L->ci->tailcalls--) /* tail calls */ luaD_callhook(L, LUA_HOOKTAILRET, -1); } return restorestack(L, fr); @@ -417,12 +417,8 @@ static int resume_error (lua_State *L, const char *msg) { LUA_API int lua_resume (lua_State *L, int nargs) { int status; lua_lock(L); - if (L->status != LUA_YIELD) { - if (L->status != 0) - return resume_error(L, "cannot resume dead coroutine"); - else if (L->ci != L->base_ci) + if (L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci)) return resume_error(L, "cannot resume non-suspended coroutine"); - } luai_userstateresume(L, nargs); lua_assert(L->errfunc == 0 && L->nCcalls == 0); status = luaD_rawrunprotected(L, resume, L->top - nargs); |