aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-12-27 14:32:29 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-12-27 14:32:29 -0200
commitba7da13ec5938f978c37d63aa40a3e340b301f79 (patch)
treec1f22403954f6e0c6d17c8495c11509103313c9a /lparser.c
parentda37ac9c7894186a0e2e0e6f1f5f00b825fd1555 (diff)
downloadlua-ba7da13ec5938f978c37d63aa40a3e340b301f79.tar.gz
lua-ba7da13ec5938f978c37d63aa40a3e340b301f79.tar.bz2
lua-ba7da13ec5938f978c37d63aa40a3e340b301f79.zip
Changes in the control of C-stack overflow
* unification of the 'nny' and 'nCcalls' counters; * external C functions ('lua_CFunction') count more "slots" in the C stack (to allow for their possible use of buffers) * added a new test script specific for C-stack overflows. (Most of those tests were already present, but concentrating them in a single script easies the task of checking whether 'LUAI_MAXCCALLS' is adequate in a system.)
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lparser.c b/lparser.c
index eed8bffd..3887958e 100644
--- a/lparser.c
+++ b/lparser.c
@@ -367,10 +367,12 @@ static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) {
367} 367}
368 368
369 369
370#define enterlevel(ls) luaE_incCcalls((ls)->L) 370/*
371 371** Macros to limit the maximum recursion depth while parsing
372*/
373#define enterlevel(ls) luaE_enterCcall((ls)->L)
372 374
373#define leavelevel(ls) ((ls)->L->nCcalls--) 375#define leavelevel(ls) luaE_exitCcall((ls)->L)
374 376
375 377
376/* 378/*