summaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-05-22 11:40:34 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-05-22 11:40:34 -0300
commit17dbaa8639505c9ad1a9946591f5960123fbd741 (patch)
treec078795bfb4a748ca05faabefafab4e35493714a /ldo.c
parent9514abc2da3525ef4314a8fcf70982ad07319e51 (diff)
downloadlua-github-17dbaa8639505c9ad1a9946591f5960123fbd741.tar.gz
Improvements in the handling of signals
Added 'volatile' to 'l_signalT' variables plus some minor changes.
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ldo.c b/ldo.c
index 64fe2915..c563b1d9 100644
--- a/ldo.c
+++ b/ldo.c
@@ -422,7 +422,7 @@ void luaD_poscall (lua_State *L, CallInfo *ci, int nres) {
-#define next_ci(L) (L->ci = (L->ci->next ? L->ci->next : luaE_extendCI(L)))
+#define next_ci(L) (L->ci->next ? L->ci->next : luaE_extendCI(L))
/*
@@ -466,13 +466,13 @@ void luaD_call (lua_State *L, StkId func, int nresults) {
f = fvalue(s2v(func));
Cfunc: {
int n; /* number of returns */
- CallInfo *ci;
+ CallInfo *ci = next_ci(L);
checkstackp(L, LUA_MINSTACK, func); /* ensure minimum stack size */
- ci = next_ci(L);
ci->nresults = nresults;
ci->callstatus = CIST_C;
ci->top = L->top + LUA_MINSTACK;
ci->func = func;
+ L->ci = ci;
lua_assert(ci->top <= L->stack_last);
if (L->hookmask & LUA_MASKCALL) {
int narg = cast_int(L->top - func) - 1;
@@ -486,18 +486,18 @@ void luaD_call (lua_State *L, StkId func, int nresults) {
break;
}
case LUA_VLCL: { /* Lua function */
- CallInfo *ci;
+ CallInfo *ci = next_ci(L);
Proto *p = clLvalue(s2v(func))->p;
int narg = cast_int(L->top - func) - 1; /* number of real arguments */
int nfixparams = p->numparams;
int fsize = p->maxstacksize; /* frame size */
checkstackp(L, fsize, func);
- ci = next_ci(L);
ci->nresults = nresults;
ci->u.l.savedpc = p->code; /* starting point */
ci->callstatus = 0;
ci->top = func + 1 + fsize;
ci->func = func;
+ L->ci = ci;
for (; narg < nfixparams; narg++)
setnilvalue(s2v(L->top++)); /* complete missing arguments */
lua_assert(ci->top <= L->stack_last);