aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ldo.c b/ldo.c
index 13498905..419b3db9 100644
--- a/ldo.c
+++ b/ldo.c
@@ -602,12 +602,17 @@ CallInfo *luaD_precall (lua_State *L, StkId func, int nresults) {
602** Call a function (C or Lua) through C. 'inc' can be 1 (increment 602** Call a function (C or Lua) through C. 'inc' can be 1 (increment
603** number of recursive invocations in the C stack) or nyci (the same 603** number of recursive invocations in the C stack) or nyci (the same
604** plus increment number of non-yieldable calls). 604** plus increment number of non-yieldable calls).
605** This function can be called with some use of EXTRA_STACK, so it should
606** check the stack before doing anything else. 'luaD_precall' already
607** does that.
605*/ 608*/
606l_sinline void ccall (lua_State *L, StkId func, int nResults, int inc) { 609l_sinline void ccall (lua_State *L, StkId func, int nResults, int inc) {
607 CallInfo *ci; 610 CallInfo *ci;
608 L->nCcalls += inc; 611 L->nCcalls += inc;
609 if (l_unlikely(getCcalls(L) >= LUAI_MAXCCALLS)) 612 if (l_unlikely(getCcalls(L) >= LUAI_MAXCCALLS)) {
613 checkstackp(L, 0, func); /* free any use of EXTRA_STACK */
610 luaE_checkcstack(L); 614 luaE_checkcstack(L);
615 }
611 if ((ci = luaD_precall(L, func, nResults)) != NULL) { /* Lua function? */ 616 if ((ci = luaD_precall(L, func, nResults)) != NULL) { /* Lua function? */
612 ci->callstatus = CIST_FRESH; /* mark that it is a "fresh" execute */ 617 ci->callstatus = CIST_FRESH; /* mark that it is a "fresh" execute */
613 luaV_execute(L, ci); /* call it */ 618 luaV_execute(L, ci); /* call it */