diff options
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.71 2009/03/10 17:14:37 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.72 2009/03/23 14:26:12 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -779,14 +779,14 @@ LUA_API void lua_callk (lua_State *L, int nargs, int nresults, int ctx, | |||
779 | api_checknelems(L, nargs+1); | 779 | api_checknelems(L, nargs+1); |
780 | checkresults(L, nargs, nresults); | 780 | checkresults(L, nargs, nresults); |
781 | func = L->top - (nargs+1); | 781 | func = L->top - (nargs+1); |
782 | if (k != NULL) { | 782 | if (k != NULL && L->nny == 0) { /* need to prepare continuation? */ |
783 | L->ci->u.c.k = k; | 783 | L->ci->u.c.k = k; /* save continuation */ |
784 | L->ci->u.c.ctx = ctx; | 784 | L->ci->u.c.ctx = ctx; /* save context */ |
785 | L->ci->callstatus |= CIST_CTX; | 785 | L->ci->callstatus |= CIST_CTX; /* mark that call has context */ |
786 | luaD_call(L, func, nresults, 1); | 786 | luaD_call(L, func, nresults, 1); /* do the call */ |
787 | } | 787 | } |
788 | else | 788 | else /* no continuation or no yieldable */ |
789 | luaD_call(L, func, nresults, 0); | 789 | luaD_call(L, func, nresults, 0); /* just do the call */ |
790 | adjustresults(L, nresults); | 790 | adjustresults(L, nresults); |
791 | lua_unlock(L); | 791 | lua_unlock(L); |
792 | } | 792 | } |