diff options
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -956,7 +956,7 @@ LUA_API void lua_callk (lua_State *L, int nargs, int nresults, | |||
956 | api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread"); | 956 | api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread"); |
957 | checkresults(L, nargs, nresults); | 957 | checkresults(L, nargs, nresults); |
958 | func = L->top - (nargs+1); | 958 | func = L->top - (nargs+1); |
959 | if (k != NULL && L->nny == 0) { /* need to prepare continuation? */ | 959 | if (k != NULL && yieldable(L)) { /* need to prepare continuation? */ |
960 | L->ci->u.c.k = k; /* save continuation */ | 960 | L->ci->u.c.k = k; /* save continuation */ |
961 | L->ci->u.c.ctx = ctx; /* save context */ | 961 | L->ci->u.c.ctx = ctx; /* save context */ |
962 | luaD_call(L, func, nresults); /* do the call */ | 962 | luaD_call(L, func, nresults); /* do the call */ |
@@ -1004,7 +1004,7 @@ LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc, | |||
1004 | func = savestack(L, o); | 1004 | func = savestack(L, o); |
1005 | } | 1005 | } |
1006 | c.func = L->top - (nargs+1); /* function to be called */ | 1006 | c.func = L->top - (nargs+1); /* function to be called */ |
1007 | if (k == NULL || L->nny > 0) { /* no continuation or no yieldable? */ | 1007 | if (k == NULL || !yieldable(L)) { /* no continuation or no yieldable? */ |
1008 | c.nresults = nresults; /* do a 'conventional' protected call */ | 1008 | c.nresults = nresults; /* do a 'conventional' protected call */ |
1009 | status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func); | 1009 | status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func); |
1010 | } | 1010 | } |