diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-07-21 14:56:59 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-07-21 14:56:59 -0300 |
commit | 15231d4fb2f6984b25e0353ff46eda1a180b686d (patch) | |
tree | fea343d493f04539a2a9ebe46c838cc5b8a01cd5 /lapi.c | |
parent | f407b3c4a1bc9667867ec51e835c20d97aab55a2 (diff) | |
download | lua-15231d4fb2f6984b25e0353ff46eda1a180b686d.tar.gz lua-15231d4fb2f6984b25e0353ff46eda1a180b686d.tar.bz2 lua-15231d4fb2f6984b25e0353ff46eda1a180b686d.zip |
'nresults' moved into 'callstatus'
That gives us more free bits in 'callstatus', for future use.
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -1103,7 +1103,7 @@ LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc, | |||
1103 | ci->u2.funcidx = cast_int(savestack(L, c.func)); | 1103 | ci->u2.funcidx = cast_int(savestack(L, c.func)); |
1104 | ci->u.c.old_errfunc = L->errfunc; | 1104 | ci->u.c.old_errfunc = L->errfunc; |
1105 | L->errfunc = func; | 1105 | L->errfunc = func; |
1106 | setoah(ci->callstatus, L->allowhook); /* save value of 'allowhook' */ | 1106 | setoah(ci, L->allowhook); /* save value of 'allowhook' */ |
1107 | ci->callstatus |= CIST_YPCALL; /* function can do error recovery */ | 1107 | ci->callstatus |= CIST_YPCALL; /* function can do error recovery */ |
1108 | luaD_call(L, c.func, nresults); /* do the call */ | 1108 | luaD_call(L, c.func, nresults); /* do the call */ |
1109 | ci->callstatus &= ~CIST_YPCALL; | 1109 | ci->callstatus &= ~CIST_YPCALL; |
@@ -1280,11 +1280,9 @@ LUA_API int lua_next (lua_State *L, int idx) { | |||
1280 | 1280 | ||
1281 | 1281 | ||
1282 | LUA_API void lua_toclose (lua_State *L, int idx) { | 1282 | LUA_API void lua_toclose (lua_State *L, int idx) { |
1283 | int nresults; | ||
1284 | StkId o; | 1283 | StkId o; |
1285 | lua_lock(L); | 1284 | lua_lock(L); |
1286 | o = index2stack(L, idx); | 1285 | o = index2stack(L, idx); |
1287 | nresults = L->ci->nresults; | ||
1288 | api_check(L, L->tbclist.p < o, "given index below or equal a marked one"); | 1286 | api_check(L, L->tbclist.p < o, "given index below or equal a marked one"); |
1289 | luaF_newtbcupval(L, o); /* create new to-be-closed upvalue */ | 1287 | luaF_newtbcupval(L, o); /* create new to-be-closed upvalue */ |
1290 | L->ci->callstatus |= CIST_CLSRET; /* mark that function has TBC slots */ | 1288 | L->ci->callstatus |= CIST_CLSRET; /* mark that function has TBC slots */ |