From 3dc5475e239e2da52a380288ae8b293a6b019f81 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 23 Aug 2011 14:24:34 -0300 Subject: 'nCcalls' should be local to each thread, as each thread may have its own C stack (with LuaThreads or something similar) --- lparser.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lparser.c') diff --git a/lparser.c b/lparser.c index 57e5d9de..8d79f21d 100644 --- a/lparser.c +++ b/lparser.c @@ -1,5 +1,5 @@ /* -** $Id: lparser.c,v 2.114 2011/07/15 12:50:29 roberto Exp roberto $ +** $Id: lparser.c,v 2.115 2011/07/27 18:09:01 roberto Exp roberto $ ** Lua Parser ** See Copyright Notice in lua.h */ @@ -328,13 +328,13 @@ static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) { static void enterlevel (LexState *ls) { - global_State *g = G(ls->L); - ++g->nCcalls; - checklimit(ls->fs, g->nCcalls, LUAI_MAXCCALLS, "syntax levels"); + lua_State *L = ls->L; + ++L->nCcalls; + checklimit(ls->fs, L->nCcalls, LUAI_MAXCCALLS, "syntax levels"); } -#define leavelevel(ls) (G((ls)->L)->nCcalls--) +#define leavelevel(ls) ((ls)->L->nCcalls--) static void closegoto (LexState *ls, int g, Labeldesc *label) { @@ -1144,7 +1144,7 @@ static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) { primaryexp(ls, &nv.v); if (nv.v.k != VINDEXED) check_conflict(ls, lh, &nv.v); - checklimit(ls->fs, nvars, LUAI_MAXCCALLS - G(ls->L)->nCcalls, + checklimit(ls->fs, nvars, LUAI_MAXCCALLS - ls->L->nCcalls, "variable names"); assignment(ls, &nv, nvars+1); } -- cgit v1.2.3-55-g6feb