diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-08-15 16:59:20 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-08-15 16:59:20 -0300 |
| commit | 93bf6185048256a5df05986460f233ee65136731 (patch) | |
| tree | d7c86e4c11eb3a834be95bfe901f1a9a89b2d9a8 /lparser.c | |
| parent | dfe2f1eeff07b0fc42f6a4255624e704d9c9beb5 (diff) | |
| download | lua-93bf6185048256a5df05986460f233ee65136731.tar.gz lua-93bf6185048256a5df05986460f233ee65136731.tar.bz2 lua-93bf6185048256a5df05986460f233ee65136731.zip | |
BUG: there is only one C stack, so nCcalls must be global
Diffstat (limited to 'lparser.c')
| -rw-r--r-- | lparser.c | 11 |
1 files changed, 6 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lparser.c,v 2.44 2006/07/11 15:53:29 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.45 2006/07/12 19:02:50 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 | */ |
| @@ -73,7 +73,7 @@ static void errorlimit (FuncState *fs, int limit, const char *what) { | |||
| 73 | luaO_pushfstring(fs->L, "main function has more than %d %s", limit, what) : | 73 | luaO_pushfstring(fs->L, "main function has more than %d %s", limit, what) : |
| 74 | luaO_pushfstring(fs->L, "function at line %d has more than %d %s", | 74 | luaO_pushfstring(fs->L, "function at line %d has more than %d %s", |
| 75 | fs->f->linedefined, limit, what); | 75 | fs->f->linedefined, limit, what); |
| 76 | luaX_lexerror(fs->ls, msg, 0); | 76 | luaX_lexerror(fs->ls, msg, fs->ls->t.token); |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | 79 | ||
| @@ -274,12 +274,13 @@ static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) { | |||
| 274 | 274 | ||
| 275 | 275 | ||
| 276 | static void enterlevel (LexState *ls) { | 276 | static void enterlevel (LexState *ls) { |
| 277 | ++ls->L->nCcalls; | 277 | global_State *g = G(ls->L); |
| 278 | luaY_checklimit(ls->fs, ls->L->nCcalls, LUAI_MAXCCALLS, "syntax levels"); | 278 | ++g->nCcalls; |
| 279 | luaY_checklimit(ls->fs, g->nCcalls, LUAI_MAXCCALLS, "syntax levels"); | ||
| 279 | } | 280 | } |
| 280 | 281 | ||
| 281 | 282 | ||
| 282 | #define leavelevel(ls) ((ls)->L->nCcalls--) | 283 | #define leavelevel(ls) (G((ls)->L)->nCcalls--) |
| 283 | 284 | ||
| 284 | 285 | ||
| 285 | static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isbreakable) { | 286 | static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isbreakable) { |
