diff options
| author | Li Jin <dragon-fly@qq.com> | 2021-01-05 16:48:53 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2021-01-05 16:48:53 +0800 |
| commit | 71b9532659abb531bd1597d88451426dcc895824 (patch) | |
| tree | c9b50856b37f759c9a31e1a6e761e77b51996fa6 /src/lua/ldo.c | |
| parent | e3a31f9945053d8e8d9e4ef3d2e4c9abe563cff2 (diff) | |
| download | yuescript-71b9532659abb531bd1597d88451426dcc895824.tar.gz yuescript-71b9532659abb531bd1597d88451426dcc895824.tar.bz2 yuescript-71b9532659abb531bd1597d88451426dcc895824.zip | |
update Lua.
Diffstat (limited to 'src/lua/ldo.c')
| -rw-r--r-- | src/lua/ldo.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lua/ldo.c b/src/lua/ldo.c index 5729b19..4b55c31 100644 --- a/src/lua/ldo.c +++ b/src/lua/ldo.c | |||
| @@ -192,7 +192,7 @@ int luaD_reallocstack (lua_State *L, int newsize, int raiseerror) { | |||
| 192 | else return 0; /* do not raise an error */ | 192 | else return 0; /* do not raise an error */ |
| 193 | } | 193 | } |
| 194 | for (; lim < newsize; lim++) | 194 | for (; lim < newsize; lim++) |
| 195 | setnilvalue(s2v(newstack + lim)); /* erase new segment */ | 195 | setnilvalue(s2v(newstack + lim + EXTRA_STACK)); /* erase new segment */ |
| 196 | correctstack(L, L->stack, newstack); | 196 | correctstack(L, L->stack, newstack); |
| 197 | L->stack = newstack; | 197 | L->stack = newstack; |
| 198 | L->stack_last = L->stack + newsize; | 198 | L->stack_last = L->stack + newsize; |
| @@ -534,11 +534,11 @@ CallInfo *luaD_precall (lua_State *L, StkId func, int nresults) { | |||
| 534 | 534 | ||
| 535 | 535 | ||
| 536 | /* | 536 | /* |
| 537 | ** Call a function (C or Lua). 'inc' can be 1 (increment number | 537 | ** Call a function (C or Lua) through C. 'inc' can be 1 (increment |
| 538 | ** of recursive invocations in the C stack) or nyci (the same plus | 538 | ** number of recursive invocations in the C stack) or nyci (the same |
| 539 | ** increment number of non-yieldable calls). | 539 | ** plus increment number of non-yieldable calls). |
| 540 | */ | 540 | */ |
| 541 | static void docall (lua_State *L, StkId func, int nResults, int inc) { | 541 | static void ccall (lua_State *L, StkId func, int nResults, int inc) { |
| 542 | CallInfo *ci; | 542 | CallInfo *ci; |
| 543 | L->nCcalls += inc; | 543 | L->nCcalls += inc; |
| 544 | if (unlikely(getCcalls(L) >= LUAI_MAXCCALLS)) | 544 | if (unlikely(getCcalls(L) >= LUAI_MAXCCALLS)) |
| @@ -552,10 +552,10 @@ static void docall (lua_State *L, StkId func, int nResults, int inc) { | |||
| 552 | 552 | ||
| 553 | 553 | ||
| 554 | /* | 554 | /* |
| 555 | ** External interface for 'docall' | 555 | ** External interface for 'ccall' |
| 556 | */ | 556 | */ |
| 557 | void luaD_call (lua_State *L, StkId func, int nResults) { | 557 | void luaD_call (lua_State *L, StkId func, int nResults) { |
| 558 | return docall(L, func, nResults, 1); | 558 | ccall(L, func, nResults, 1); |
| 559 | } | 559 | } |
| 560 | 560 | ||
| 561 | 561 | ||
| @@ -563,7 +563,7 @@ void luaD_call (lua_State *L, StkId func, int nResults) { | |||
| 563 | ** Similar to 'luaD_call', but does not allow yields during the call. | 563 | ** Similar to 'luaD_call', but does not allow yields during the call. |
| 564 | */ | 564 | */ |
| 565 | void luaD_callnoyield (lua_State *L, StkId func, int nResults) { | 565 | void luaD_callnoyield (lua_State *L, StkId func, int nResults) { |
| 566 | return docall(L, func, nResults, nyci); | 566 | ccall(L, func, nResults, nyci); |
| 567 | } | 567 | } |
| 568 | 568 | ||
| 569 | 569 | ||
| @@ -678,7 +678,7 @@ static void resume (lua_State *L, void *ud) { | |||
| 678 | StkId firstArg = L->top - n; /* first argument */ | 678 | StkId firstArg = L->top - n; /* first argument */ |
| 679 | CallInfo *ci = L->ci; | 679 | CallInfo *ci = L->ci; |
| 680 | if (L->status == LUA_OK) /* starting a coroutine? */ | 680 | if (L->status == LUA_OK) /* starting a coroutine? */ |
| 681 | docall(L, firstArg - 1, LUA_MULTRET, 1); /* just call its body */ | 681 | ccall(L, firstArg - 1, LUA_MULTRET, 1); /* just call its body */ |
| 682 | else { /* resuming from previous yield */ | 682 | else { /* resuming from previous yield */ |
| 683 | lua_assert(L->status == LUA_YIELD); | 683 | lua_assert(L->status == LUA_YIELD); |
| 684 | L->status = LUA_OK; /* mark that it is running (again) */ | 684 | L->status = LUA_OK; /* mark that it is running (again) */ |
