diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-07-02 12:58:14 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-07-02 12:58:14 -0300 |
commit | d93df22bf64112496c70d51f2bc8f32439b61098 (patch) | |
tree | dbbaee31d9d649f312d94b7a06c4466ff28354fe /lparser.c | |
parent | 5017cc6ba299c317ca4904c6a464fd67ef1eec36 (diff) | |
download | lua-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.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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) { | |||
1398 | static void localfunc (LexState *ls) { | 1398 | static 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 | ||