mirror of
https://github.com/lua/lua
synced 2025-04-22 21:42:41 +03:00
small simplifications (and assert was wrongly written)
This commit is contained in:
parent
5017cc6ba2
commit
d93df22bf6
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lparser.c,v 2.111 2011/06/20 16:52:48 roberto Exp roberto $
|
** $Id: lparser.c,v 2.112 2011/06/27 18:18:59 roberto Exp roberto $
|
||||||
** Lua Parser
|
** Lua Parser
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -1398,13 +1398,11 @@ static void ifstat (LexState *ls, int line) {
|
|||||||
static void localfunc (LexState *ls) {
|
static void localfunc (LexState *ls) {
|
||||||
expdesc b;
|
expdesc b;
|
||||||
FuncState *fs = ls->fs;
|
FuncState *fs = ls->fs;
|
||||||
int varidx = fs->nactvar; /* index of new local variable */
|
|
||||||
new_localvar(ls, str_checkname(ls)); /* new local variable */
|
new_localvar(ls, str_checkname(ls)); /* new local variable */
|
||||||
adjustlocalvars(ls, 1); /* enter its scope */
|
adjustlocalvars(ls, 1); /* enter its scope */
|
||||||
body(ls, &b, 0, ls->linenumber); /* function created in next register */
|
body(ls, &b, 0, ls->linenumber); /* function created in next register */
|
||||||
lua_assert(b.k == VNONRELOC && b.u.ind.idx == varidx);
|
|
||||||
/* debug information will only see the variable after this point! */
|
/* debug information will only see the variable after this point! */
|
||||||
getlocvar(fs, varidx)->startpc = fs->pc;
|
getlocvar(fs, b.u.info)->startpc = fs->pc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user