aboutsummaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ltm.c b/ltm.c
index 3629dc69..cbc4cc5e 100644
--- a/ltm.c
+++ b/ltm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.c,v 2.41 2017/05/13 12:57:20 roberto Exp roberto $ 2** $Id: ltm.c,v 2.42 2017/06/29 15:06:44 roberto Exp roberto $
3** Tag methods 3** Tag methods
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -188,7 +188,7 @@ void luaT_adjustvarargs (lua_State *L, Proto *p, int actual) {
188 luaH_resize(L, vtab, actual, 1); 188 luaH_resize(L, vtab, actual, 1);
189 for (i = 0; i < actual; i++) /* put extra arguments into vararg table */ 189 for (i = 0; i < actual; i++) /* put extra arguments into vararg table */
190 setobj2n(L, &vtab->array[i], s2v(L->top - actual + i - 1)); 190 setobj2n(L, &vtab->array[i], s2v(L->top - actual + i - 1));
191 setsvalue(L, &nname, luaS_newliteral(L, "n")); /* get field 'n' */ 191 setsvalue(L, &nname, G(L)->nfield); /* get field 'n' */
192 setivalue(luaH_set(L, vtab, &nname), actual); /* store counter there */ 192 setivalue(luaH_set(L, vtab, &nname), actual); /* store counter there */
193 L->top -= actual; /* remove extra elements from the stack */ 193 L->top -= actual; /* remove extra elements from the stack */
194 sethvalue2s(L, L->top - 1, vtab); /* move table to new top */ 194 sethvalue2s(L, L->top - 1, vtab); /* move table to new top */
@@ -202,7 +202,7 @@ void luaT_getvarargs (lua_State *L, TValue *t, StkId where, int wanted) {
202 int i; 202 int i;
203 Table *h = hvalue(t); 203 Table *h = hvalue(t);
204 if (wanted < 0) { /* get all? */ 204 if (wanted < 0) { /* get all? */
205 const TValue *ns = luaH_getstr(h, luaS_newliteral(L, "n")); 205 const TValue *ns = luaH_getstr(h, G(L)->nfield);
206 int n = (ttisinteger(ns)) ? ivalue(ns) : 0; 206 int n = (ttisinteger(ns)) ? ivalue(ns) : 0;
207 wanted = n; 207 wanted = n;
208 checkstackp(L, n, where); 208 checkstackp(L, n, where);