aboutsummaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
authorRoberto I <roberto@inf.puc-rio.br>2025-09-17 16:07:48 -0300
committerRoberto I <roberto@inf.puc-rio.br>2025-09-17 16:07:48 -0300
commit8fb1af0e33cd8688f57cd0e3ab86420a8cfe99bd (patch)
tree2c199de5e67f395a4f9c94fcfb2ef3f0dad8882a /ltm.c
parent140b672e2ee2ac842661ece4b48e1a64f0cd11ea (diff)
downloadlua-8fb1af0e33cd8688f57cd0e3ab86420a8cfe99bd.tar.gz
lua-8fb1af0e33cd8688f57cd0e3ab86420a8cfe99bd.tar.bz2
lua-8fb1af0e33cd8688f57cd0e3ab86420a8cfe99bd.zip
Varag parameter is a new kind of variable
To allow some optimizations on its use.
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ltm.c b/ltm.c
index 619be59e..cc812e62 100644
--- a/ltm.c
+++ b/ltm.c
@@ -265,11 +265,11 @@ void luaT_adjustvarargs (lua_State *L, CallInfo *ci, const Proto *p) {
265 setobjs2s(L, L->top.p++, ci->func.p + i); 265 setobjs2s(L, L->top.p++, ci->func.p + i);
266 setnilvalue(s2v(ci->func.p + i)); /* erase original parameter (for GC) */ 266 setnilvalue(s2v(ci->func.p + i)); /* erase original parameter (for GC) */
267 } 267 }
268 if (p->flag & (PF_VAPTAB | PF_VATAB)) { /* is there a vararg table? */ 268 if (p->flag & PF_VAVAR) { /* is there a vararg parameter? */
269 if (p->flag & PF_VAPTAB) /* is vararg table fake? */ 269 if (p->flag & PF_VATAB) /* does it need a vararg table? */
270 setnilvalue(s2v(L->top.p)); /* initialize it */
271 else
272 createvarargtab(L, ci->func.p + nfixparams + 1, nextra); 270 createvarargtab(L, ci->func.p + nfixparams + 1, nextra);
271 else /* no table; set parameter to nil */
272 setnilvalue(s2v(L->top.p));
273 } 273 }
274 ci->func.p += totalargs + 1; 274 ci->func.p += totalargs + 1;
275 ci->top.p += totalargs + 1; 275 ci->top.p += totalargs + 1;