diff options
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 | */ |
606 | l_sinline void ccall (lua_State *L, StkId func, int nResults, int inc) { | 609 | l_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 */ |