diff options
Diffstat (limited to 'ldo.c')
| -rw-r--r-- | ldo.c | 12 |
1 files changed, 6 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.c,v 2.5 2004/05/14 19:25:09 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.6 2004/05/31 18:51:50 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 | */ |
| @@ -256,8 +256,8 @@ int luaD_precall (lua_State *L, StkId func, int nresults) { | |||
| 256 | ci->func = func; | 256 | ci->func = func; |
| 257 | L->base = ci->base = base; | 257 | L->base = ci->base = base; |
| 258 | ci->top = L->base + p->maxstacksize; | 258 | ci->top = L->base + p->maxstacksize; |
| 259 | ci->u.l.savedpc = p->code; /* starting point */ | 259 | ci->savedpc = p->code; /* starting point */ |
| 260 | ci->u.l.tailcalls = 0; | 260 | ci->tailcalls = 0; |
| 261 | ci->nresults = nresults; | 261 | ci->nresults = nresults; |
| 262 | for (st = L->top; st < ci->top; st++) | 262 | for (st = L->top; st < ci->top; st++) |
| 263 | setnilvalue(st); | 263 | setnilvalue(st); |
| @@ -293,7 +293,7 @@ static StkId callrethooks (lua_State *L, StkId firstResult) { | |||
| 293 | ptrdiff_t fr = savestack(L, firstResult); /* next call may change stack */ | 293 | ptrdiff_t fr = savestack(L, firstResult); /* next call may change stack */ |
| 294 | luaD_callhook(L, LUA_HOOKRET, -1); | 294 | luaD_callhook(L, LUA_HOOKRET, -1); |
| 295 | if (f_isLua(L->ci)) { /* Lua function? */ | 295 | if (f_isLua(L->ci)) { /* Lua function? */ |
| 296 | while (L->ci->u.l.tailcalls--) /* call hook for eventual tail calls */ | 296 | while (L->ci->tailcalls--) /* call hook for eventual tail calls */ |
| 297 | luaD_callhook(L, LUA_HOOKTAILRET, -1); | 297 | luaD_callhook(L, LUA_HOOKTAILRET, -1); |
| 298 | } | 298 | } |
| 299 | return restorestack(L, fr); | 299 | return restorestack(L, fr); |
| @@ -352,8 +352,8 @@ static void resume (lua_State *L, void *ud) { | |||
| 352 | if (!f_isLua(ci)) { /* `common' yield? */ | 352 | if (!f_isLua(ci)) { /* `common' yield? */ |
| 353 | /* finish interrupted execution of `OP_CALL' */ | 353 | /* finish interrupted execution of `OP_CALL' */ |
| 354 | int nresults = ci->nresults; | 354 | int nresults = ci->nresults; |
| 355 | lua_assert(GET_OPCODE(*((ci-1)->u.l.savedpc - 1)) == OP_CALL || | 355 | lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL || |
| 356 | GET_OPCODE(*((ci-1)->u.l.savedpc - 1)) == OP_TAILCALL); | 356 | GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_TAILCALL); |
| 357 | luaD_poscall(L, nresults, L->top - nargs); /* complete it */ | 357 | luaD_poscall(L, nresults, L->top - nargs); /* complete it */ |
| 358 | if (nresults >= 0) L->top = L->ci->top; | 358 | if (nresults >= 0) L->top = L->ci->top; |
| 359 | } /* else yielded inside a hook: just continue its execution */ | 359 | } /* else yielded inside a hook: just continue its execution */ |
