diff options
author | Li Jin <dragon-fly@qq.com> | 2020-08-06 01:00:41 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2020-08-06 01:00:41 +0800 |
commit | 2506c1b429e952245295e54e71dac4b345e88984 (patch) | |
tree | ef9f243b6ca18d07b2734041c93fb496cdd8d796 /src/lua/ldo.c | |
parent | c74f45ba9778792e6f5a239539d25fd7918252f7 (diff) | |
download | yuescript-2506c1b429e952245295e54e71dac4b345e88984.tar.gz yuescript-2506c1b429e952245295e54e71dac4b345e88984.tar.bz2 yuescript-2506c1b429e952245295e54e71dac4b345e88984.zip |
update Lua 5.4.
Diffstat (limited to 'src/lua/ldo.c')
-rw-r--r-- | src/lua/ldo.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/lua/ldo.c b/src/lua/ldo.c index 4c976a1..5473815 100644 --- a/src/lua/ldo.c +++ b/src/lua/ldo.c | |||
@@ -327,7 +327,7 @@ static StkId rethook (lua_State *L, CallInfo *ci, StkId firstres, int nres) { | |||
327 | ptrdiff_t oldtop = savestack(L, L->top); /* hook may change top */ | 327 | ptrdiff_t oldtop = savestack(L, L->top); /* hook may change top */ |
328 | int delta = 0; | 328 | int delta = 0; |
329 | if (isLuacode(ci)) { | 329 | if (isLuacode(ci)) { |
330 | Proto *p = clLvalue(s2v(ci->func))->p; | 330 | Proto *p = ci_func(ci)->p; |
331 | if (p->is_vararg) | 331 | if (p->is_vararg) |
332 | delta = ci->u.l.nextraargs + p->numparams + 1; | 332 | delta = ci->u.l.nextraargs + p->numparams + 1; |
333 | if (L->top < ci->top) | 333 | if (L->top < ci->top) |
@@ -340,8 +340,8 @@ static StkId rethook (lua_State *L, CallInfo *ci, StkId firstres, int nres) { | |||
340 | luaD_hook(L, LUA_HOOKRET, -1, ftransfer, nres); /* call it */ | 340 | luaD_hook(L, LUA_HOOKRET, -1, ftransfer, nres); /* call it */ |
341 | ci->func -= delta; | 341 | ci->func -= delta; |
342 | } | 342 | } |
343 | if (isLua(ci->previous)) | 343 | if (isLua(ci = ci->previous)) |
344 | L->oldpc = ci->previous->u.l.savedpc; /* update 'oldpc' */ | 344 | L->oldpc = pcRel(ci->u.l.savedpc, ci_func(ci)->p); /* update 'oldpc' */ |
345 | return restorestack(L, oldtop); | 345 | return restorestack(L, oldtop); |
346 | } | 346 | } |
347 | 347 | ||
@@ -515,14 +515,13 @@ void luaD_call (lua_State *L, StkId func, int nresults) { | |||
515 | 515 | ||
516 | /* | 516 | /* |
517 | ** Similar to 'luaD_call', but does not allow yields during the call. | 517 | ** Similar to 'luaD_call', but does not allow yields during the call. |
518 | ** If there is a stack overflow, freeing all CI structures will | ||
519 | ** force the subsequent call to invoke 'luaE_extendCI', which then | ||
520 | ** will raise any errors. | ||
521 | */ | 518 | */ |
522 | void luaD_callnoyield (lua_State *L, StkId func, int nResults) { | 519 | void luaD_callnoyield (lua_State *L, StkId func, int nResults) { |
523 | incXCcalls(L); | 520 | incXCcalls(L); |
524 | if (getCcalls(L) <= CSTACKERR) /* possible stack overflow? */ | 521 | if (getCcalls(L) <= CSTACKERR) { /* possible C stack overflow? */ |
525 | luaE_freeCI(L); | 522 | luaE_exitCcall(L); /* to compensate decrement in next call */ |
523 | luaE_enterCcall(L); /* check properly */ | ||
524 | } | ||
526 | luaD_call(L, func, nResults); | 525 | luaD_call(L, func, nResults); |
527 | decXCcalls(L); | 526 | decXCcalls(L); |
528 | } | 527 | } |