summaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-07-07 17:38:29 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-07-07 17:38:29 -0300
commitdbbe0f7971dfe89368224010352d2c08d13ef44f (patch)
tree4aedc09477bda5f47ac6d5370e00c078810c468d /ltm.c
parent0ca522c254911aed6657134959d4f7017dd853e3 (diff)
downloadlua-github-temporary.tar.gz
Fixed bug in 'checkstackp'temporary
The macro 'checkstackp' can run a GC step and destroy a preallocated CallInfo. It has been renamed to 'checkstackGCp' to hint of this collateral effect.
Diffstat (limited to 'ltm.c')
-rw-r--r--ltm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ltm.c b/ltm.c
index ae60983f..4770f96b 100644
--- a/ltm.c
+++ b/ltm.c
@@ -240,7 +240,7 @@ void luaT_adjustvarargs (lua_State *L, int nfixparams, CallInfo *ci,
int actual = cast_int(L->top - ci->func) - 1; /* number of arguments */
int nextra = actual - nfixparams; /* number of extra arguments */
ci->u.l.nextraargs = nextra;
- checkstackGC(L, p->maxstacksize + 1);
+ luaD_checkstack(L, p->maxstacksize + 1);
/* copy function to the top of the stack */
setobjs2s(L, L->top++, ci->func);
/* move fixed parameters to the top of the stack */
@@ -259,7 +259,7 @@ void luaT_getvarargs (lua_State *L, CallInfo *ci, StkId where, int wanted) {
int nextra = ci->u.l.nextraargs;
if (wanted < 0) {
wanted = nextra; /* get all extra arguments available */
- checkstackp(L, nextra, where); /* ensure stack space */
+ checkstackGCp(L, nextra, where); /* ensure stack space */
L->top = where + nextra; /* next instruction will need top */
}
for (i = 0; i < wanted && i < nextra; i++)