aboutsummaryrefslogtreecommitdiff
path: root/src/lua/ltm.c
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2020-07-18 16:45:50 +0800
committerLi Jin <dragon-fly@qq.com>2020-07-18 16:45:50 +0800
commit8c596dc1efa8a1267c222b168a4de9c8ba254760 (patch)
tree699c748e101a48ae267b5f7b19adbfea15f3934e /src/lua/ltm.c
parent8ab0038c09a79fa8401bb10b7a31d03ef5380417 (diff)
downloadyuescript-8c596dc1efa8a1267c222b168a4de9c8ba254760.tar.gz
yuescript-8c596dc1efa8a1267c222b168a4de9c8ba254760.tar.bz2
yuescript-8c596dc1efa8a1267c222b168a4de9c8ba254760.zip
fix issue for using return statement with export.
Diffstat (limited to 'src/lua/ltm.c')
-rw-r--r--src/lua/ltm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lua/ltm.c b/src/lua/ltm.c
index ae60983..4770f96 100644
--- a/src/lua/ltm.c
+++ b/src/lua/ltm.c
@@ -240,7 +240,7 @@ void luaT_adjustvarargs (lua_State *L, int nfixparams, CallInfo *ci,
240 int actual = cast_int(L->top - ci->func) - 1; /* number of arguments */ 240 int actual = cast_int(L->top - ci->func) - 1; /* number of arguments */
241 int nextra = actual - nfixparams; /* number of extra arguments */ 241 int nextra = actual - nfixparams; /* number of extra arguments */
242 ci->u.l.nextraargs = nextra; 242 ci->u.l.nextraargs = nextra;
243 checkstackGC(L, p->maxstacksize + 1); 243 luaD_checkstack(L, p->maxstacksize + 1);
244 /* copy function to the top of the stack */ 244 /* copy function to the top of the stack */
245 setobjs2s(L, L->top++, ci->func); 245 setobjs2s(L, L->top++, ci->func);
246 /* move fixed parameters to the top of the stack */ 246 /* 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) {
259 int nextra = ci->u.l.nextraargs; 259 int nextra = ci->u.l.nextraargs;
260 if (wanted < 0) { 260 if (wanted < 0) {
261 wanted = nextra; /* get all extra arguments available */ 261 wanted = nextra; /* get all extra arguments available */
262 checkstackp(L, nextra, where); /* ensure stack space */ 262 checkstackGCp(L, nextra, where); /* ensure stack space */
263 L->top = where + nextra; /* next instruction will need top */ 263 L->top = where + nextra; /* next instruction will need top */
264 } 264 }
265 for (i = 0; i < wanted && i < nextra; i++) 265 for (i = 0; i < wanted && i < nextra; i++)