summaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lparser.c b/lparser.c
index bc7d9a4f..502a9b2d 100644
--- a/lparser.c
+++ b/lparser.c
@@ -489,12 +489,14 @@ static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) {
}
-/*
-** Macros to limit the maximum recursion depth while parsing
-*/
-#define enterlevel(ls) luaE_enterCcall((ls)->L)
+static void enterlevel (LexState *ls) {
+ lua_State *L = ls->L;
+ L->nCcalls++;
+ checklimit(ls->fs, getCcalls(L), LUAI_MAXCCALLS, "C levels");
+}
+
-#define leavelevel(ls) luaE_exitCcall((ls)->L)
+#define leavelevel(ls) ((ls)->L->nCcalls--)
/*