diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-01-28 10:08:04 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-01-28 10:08:04 -0200 |
| commit | 53979dfe0dbd7eba767ff37b1148d1e4dc9f8294 (patch) | |
| tree | cdb8fac7540edc3fcd7695aa6cf09fdc5e171b53 /ltm.c | |
| parent | 6710a2b0ef164cb5bf3412353400aada5ac3f373 (diff) | |
| download | lua-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -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 | ||
