summaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-11-23 14:41:16 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-11-23 14:41:16 -0200
commit196c87c9cecfacf978f37de4ec69eba0a5971256 (patch)
treece434c8a63228cf1f25adcc2210ba741ee899887 /lparser.c
parent39f26b1480502cc2f75a5af6e06e5410e06634ba (diff)
downloadlua-github-196c87c9cecfacf978f37de4ec69eba0a5971256.tar.gz
no more 'stackless' implementation; 'luaV_execute' calls itself
recursively to execute function calls. 'unroll' continues all executions suspended by an yield (through a long jump)
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lparser.c b/lparser.c
index 0637a0b7..3eb83fba 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
/*
-** $Id: lparser.c,v 2.166 2017/09/28 16:53:29 roberto Exp roberto $
+** $Id: lparser.c,v 2.167 2017/10/04 21:53:03 roberto Exp roberto $
** Lua Parser
** See Copyright Notice in lua.h
*/
@@ -330,11 +330,7 @@ static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) {
}
-static void enterlevel (LexState *ls) {
- lua_State *L = ls->L;
- ++L->nCcalls;
- checklimit(ls->fs, L->nCcalls, LUAI_MAXCCALLS, "C levels");
-}
+#define enterlevel(ls) luaE_incCcalls((ls)->L)
#define leavelevel(ls) ((ls)->L->nCcalls--)
@@ -1188,9 +1184,9 @@ static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) {
suffixedexp(ls, &nv.v);
if (!vkisindexed(nv.v.k))
check_conflict(ls, lh, &nv.v);
- checklimit(ls->fs, nvars + ls->L->nCcalls, LUAI_MAXCCALLS,
- "C levels");
+ luaE_incCcalls(ls->L); /* control recursion depth */
assignment(ls, &nv, nvars+1);
+ ls->L->nCcalls--;
}
else { /* assignment -> '=' explist */
int nexps;