aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-08-23 14:24:34 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-08-23 14:24:34 -0300
commit3dc5475e239e2da52a380288ae8b293a6b019f81 (patch)
tree3da13bd67407f9717b5fb9a024dca38b78589bfc /lparser.c
parent8a008a20579dd6818cb770147c8765b72eb2acfe (diff)
downloadlua-3dc5475e239e2da52a380288ae8b293a6b019f81.tar.gz
lua-3dc5475e239e2da52a380288ae8b293a6b019f81.tar.bz2
lua-3dc5475e239e2da52a380288ae8b293a6b019f81.zip
'nCcalls' should be local to each thread, as each thread may have its
own C stack (with LuaThreads or something similar)
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lparser.c b/lparser.c
index 57e5d9de..8d79f21d 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 2.114 2011/07/15 12:50:29 roberto Exp roberto $ 2** $Id: lparser.c,v 2.115 2011/07/27 18:09:01 roberto Exp roberto $
3** Lua Parser 3** Lua Parser
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -328,13 +328,13 @@ static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) {
328 328
329 329
330static void enterlevel (LexState *ls) { 330static void enterlevel (LexState *ls) {
331 global_State *g = G(ls->L); 331 lua_State *L = ls->L;
332 ++g->nCcalls; 332 ++L->nCcalls;
333 checklimit(ls->fs, g->nCcalls, LUAI_MAXCCALLS, "syntax levels"); 333 checklimit(ls->fs, L->nCcalls, LUAI_MAXCCALLS, "syntax levels");
334} 334}
335 335
336 336
337#define leavelevel(ls) (G((ls)->L)->nCcalls--) 337#define leavelevel(ls) ((ls)->L->nCcalls--)
338 338
339 339
340static void closegoto (LexState *ls, int g, Labeldesc *label) { 340static void closegoto (LexState *ls, int g, Labeldesc *label) {
@@ -1144,7 +1144,7 @@ static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) {
1144 primaryexp(ls, &nv.v); 1144 primaryexp(ls, &nv.v);
1145 if (nv.v.k != VINDEXED) 1145 if (nv.v.k != VINDEXED)
1146 check_conflict(ls, lh, &nv.v); 1146 check_conflict(ls, lh, &nv.v);
1147 checklimit(ls->fs, nvars, LUAI_MAXCCALLS - G(ls->L)->nCcalls, 1147 checklimit(ls->fs, nvars, LUAI_MAXCCALLS - ls->L->nCcalls,
1148 "variable names"); 1148 "variable names");
1149 assignment(ls, &nv, nvars+1); 1149 assignment(ls, &nv, nvars+1);
1150 } 1150 }