aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-07-02 12:58:14 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-07-02 12:58:14 -0300
commitd93df22bf64112496c70d51f2bc8f32439b61098 (patch)
treedbbaee31d9d649f312d94b7a06c4466ff28354fe /lparser.c
parent5017cc6ba299c317ca4904c6a464fd67ef1eec36 (diff)
downloadlua-d93df22bf64112496c70d51f2bc8f32439b61098.tar.gz
lua-d93df22bf64112496c70d51f2bc8f32439b61098.tar.bz2
lua-d93df22bf64112496c70d51f2bc8f32439b61098.zip
small simplifications (and assert was wrongly written)
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lparser.c b/lparser.c
index e233cf8f..03f87176 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 2.111 2011/06/20 16:52:48 roberto Exp roberto $ 2** $Id: lparser.c,v 2.112 2011/06/27 18:18:59 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*/
@@ -1398,13 +1398,11 @@ static void ifstat (LexState *ls, int line) {
1398static void localfunc (LexState *ls) { 1398static void localfunc (LexState *ls) {
1399 expdesc b; 1399 expdesc b;
1400 FuncState *fs = ls->fs; 1400 FuncState *fs = ls->fs;
1401 int varidx = fs->nactvar; /* index of new local variable */
1402 new_localvar(ls, str_checkname(ls)); /* new local variable */ 1401 new_localvar(ls, str_checkname(ls)); /* new local variable */
1403 adjustlocalvars(ls, 1); /* enter its scope */ 1402 adjustlocalvars(ls, 1); /* enter its scope */
1404 body(ls, &b, 0, ls->linenumber); /* function created in next register */ 1403 body(ls, &b, 0, ls->linenumber); /* function created in next register */
1405 lua_assert(b.k == VNONRELOC && b.u.ind.idx == varidx);
1406 /* debug information will only see the variable after this point! */ 1404 /* debug information will only see the variable after this point! */
1407 getlocvar(fs, varidx)->startpc = fs->pc; 1405 getlocvar(fs, b.u.info)->startpc = fs->pc;
1408} 1406}
1409 1407
1410 1408