diff options
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -422,7 +422,7 @@ void luaD_poscall (lua_State *L, CallInfo *ci, int nres) { | |||
422 | 422 | ||
423 | 423 | ||
424 | 424 | ||
425 | #define next_ci(L) (L->ci = (L->ci->next ? L->ci->next : luaE_extendCI(L))) | 425 | #define next_ci(L) (L->ci->next ? L->ci->next : luaE_extendCI(L)) |
426 | 426 | ||
427 | 427 | ||
428 | /* | 428 | /* |
@@ -466,13 +466,13 @@ void luaD_call (lua_State *L, StkId func, int nresults) { | |||
466 | f = fvalue(s2v(func)); | 466 | f = fvalue(s2v(func)); |
467 | Cfunc: { | 467 | Cfunc: { |
468 | int n; /* number of returns */ | 468 | int n; /* number of returns */ |
469 | CallInfo *ci; | 469 | CallInfo *ci = next_ci(L); |
470 | checkstackp(L, LUA_MINSTACK, func); /* ensure minimum stack size */ | 470 | checkstackp(L, LUA_MINSTACK, func); /* ensure minimum stack size */ |
471 | ci = next_ci(L); | ||
472 | ci->nresults = nresults; | 471 | ci->nresults = nresults; |
473 | ci->callstatus = CIST_C; | 472 | ci->callstatus = CIST_C; |
474 | ci->top = L->top + LUA_MINSTACK; | 473 | ci->top = L->top + LUA_MINSTACK; |
475 | ci->func = func; | 474 | ci->func = func; |
475 | L->ci = ci; | ||
476 | lua_assert(ci->top <= L->stack_last); | 476 | lua_assert(ci->top <= L->stack_last); |
477 | if (L->hookmask & LUA_MASKCALL) { | 477 | if (L->hookmask & LUA_MASKCALL) { |
478 | int narg = cast_int(L->top - func) - 1; | 478 | int narg = cast_int(L->top - func) - 1; |
@@ -486,18 +486,18 @@ void luaD_call (lua_State *L, StkId func, int nresults) { | |||
486 | break; | 486 | break; |
487 | } | 487 | } |
488 | case LUA_VLCL: { /* Lua function */ | 488 | case LUA_VLCL: { /* Lua function */ |
489 | CallInfo *ci; | 489 | CallInfo *ci = next_ci(L); |
490 | Proto *p = clLvalue(s2v(func))->p; | 490 | Proto *p = clLvalue(s2v(func))->p; |
491 | int narg = cast_int(L->top - func) - 1; /* number of real arguments */ | 491 | int narg = cast_int(L->top - func) - 1; /* number of real arguments */ |
492 | int nfixparams = p->numparams; | 492 | int nfixparams = p->numparams; |
493 | int fsize = p->maxstacksize; /* frame size */ | 493 | int fsize = p->maxstacksize; /* frame size */ |
494 | checkstackp(L, fsize, func); | 494 | checkstackp(L, fsize, func); |
495 | ci = next_ci(L); | ||
496 | ci->nresults = nresults; | 495 | ci->nresults = nresults; |
497 | ci->u.l.savedpc = p->code; /* starting point */ | 496 | ci->u.l.savedpc = p->code; /* starting point */ |
498 | ci->callstatus = 0; | 497 | ci->callstatus = 0; |
499 | ci->top = func + 1 + fsize; | 498 | ci->top = func + 1 + fsize; |
500 | ci->func = func; | 499 | ci->func = func; |
500 | L->ci = ci; | ||
501 | for (; narg < nfixparams; narg++) | 501 | for (; narg < nfixparams; narg++) |
502 | setnilvalue(s2v(L->top++)); /* complete missing arguments */ | 502 | setnilvalue(s2v(L->top++)); /* complete missing arguments */ |
503 | lua_assert(ci->top <= L->stack_last); | 503 | lua_assert(ci->top <= L->stack_last); |