aboutsummaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-01-28 10:08:04 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-01-28 10:08:04 -0200
commit53979dfe0dbd7eba767ff37b1148d1e4dc9f8294 (patch)
treecdb8fac7540edc3fcd7695aa6cf09fdc5e171b53 /ltm.c
parent6710a2b0ef164cb5bf3412353400aada5ac3f373 (diff)
downloadlua-53979dfe0dbd7eba767ff37b1148d1e4dc9f8294.tar.gz
lua-53979dfe0dbd7eba767ff37b1148d1e4dc9f8294.tar.bz2
lua-53979dfe0dbd7eba767ff37b1148d1e4dc9f8294.zip
calling a vararg function needs to check GC
(because it creates a new table)
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ltm.c b/ltm.c
index 4b14f197..8108abb2 100644
--- a/ltm.c
+++ b/ltm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.c,v 2.55 2017/12/20 14:58:05 roberto Exp roberto $ 2** $Id: ltm.c,v 2.56 2017/12/28 15:42:57 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*/
@@ -16,6 +16,7 @@
16 16
17#include "ldebug.h" 17#include "ldebug.h"
18#include "ldo.h" 18#include "ldo.h"
19#include "lgc.h"
19#include "lobject.h" 20#include "lobject.h"
20#include "lstate.h" 21#include "lstate.h"
21#include "lstring.h" 22#include "lstring.h"
@@ -231,6 +232,7 @@ void luaT_adjustvarargs (lua_State *L, Proto *p, int actual) {
231 setivalue(luaH_set(L, vtab, &nname), actual); /* store counter there */ 232 setivalue(luaH_set(L, vtab, &nname), actual); /* store counter there */
232 L->top -= actual; /* remove extra elements from the stack */ 233 L->top -= actual; /* remove extra elements from the stack */
233 sethvalue2s(L, L->top - 1, vtab); /* move table to new top */ 234 sethvalue2s(L, L->top - 1, vtab); /* move table to new top */
235 luaC_checkGC(L);
234} 236}
235 237
236 238