aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ldo.c b/ldo.c
index 7e8f2cdb..ef1e045b 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 2.72 2009/11/17 16:46:44 roberto Exp roberto $ 2** $Id: ldo.c,v 2.73 2009/11/25 15:27:51 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*/
@@ -311,6 +311,7 @@ int luaD_precall (lua_State *L, StkId func, int nresults) {
311 lua_unlock(L); 311 lua_unlock(L);
312 n = (*curr_func(L)->c.f)(L); /* do the actual call */ 312 n = (*curr_func(L)->c.f)(L); /* do the actual call */
313 lua_lock(L); 313 lua_lock(L);
314 api_checknelems(L, n);
314 luaD_poscall(L, L->top - n); 315 luaD_poscall(L, L->top - n);
315 return 1; 316 return 1;
316 } 317 }
@@ -382,6 +383,7 @@ static void finishCcall (lua_State *L) {
382 lua_unlock(L); 383 lua_unlock(L);
383 n = (*ci->u.c.k)(L); 384 n = (*ci->u.c.k)(L);
384 lua_lock(L); 385 lua_lock(L);
386 api_checknelems(L, n);
385 /* finish 'luaD_precall' */ 387 /* finish 'luaD_precall' */
386 luaD_poscall(L, L->top - n); 388 luaD_poscall(L, L->top - n);
387} 389}
@@ -424,6 +426,7 @@ static void resume (lua_State *L, void *ud) {
424 lua_unlock(L); 426 lua_unlock(L);
425 n = (*ci->u.c.k)(L); /* call continuation */ 427 n = (*ci->u.c.k)(L); /* call continuation */
426 lua_lock(L); 428 lua_lock(L);
429 api_checknelems(L, n);
427 firstArg = L->top - n; 430 firstArg = L->top - n;
428 } 431 }
429 G(L)->nCcalls--; /* finish 'luaD_call' */ 432 G(L)->nCcalls--; /* finish 'luaD_call' */
@@ -511,6 +514,7 @@ LUA_API int lua_yieldk (lua_State *L, int nresults, int ctx, lua_CFunction k) {
511 CallInfo *ci = L->ci; 514 CallInfo *ci = L->ci;
512 luai_userstateyield(L, nresults); 515 luai_userstateyield(L, nresults);
513 lua_lock(L); 516 lua_lock(L);
517 api_checknelems(L, nresults);
514 if (L->nny > 0) 518 if (L->nny > 0)
515 luaG_runerror(L, "attempt to yield across metamethod/C-call boundary"); 519 luaG_runerror(L, "attempt to yield across metamethod/C-call boundary");
516 L->status = LUA_YIELD; 520 L->status = LUA_YIELD;