summaryrefslogtreecommitdiff
path: root/src/lparser.c
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2003-11-25 12:00:00 +0000
committerrepogen <>2003-11-25 12:00:00 +0000
commit72286a8eeb927e1a33f24e9d99bb37ec5343ad45 (patch)
tree5a325cc1666ee447433fd4a565ec7f12be57f00f /src/lparser.c
parentf0e4e22f5c119865eb5a8d3844a40df2d5980b3b (diff)
downloadlua-github-5.0.1.tar.gz
Lua 5.0.15.0.1
Diffstat (limited to 'src/lparser.c')
-rw-r--r--src/lparser.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lparser.c b/src/lparser.c
index c1323ecd..99bd3020 100644
--- a/src/lparser.c
+++ b/src/lparser.c
@@ -1,5 +1,5 @@
/*
-** $Id: lparser.c,v 1.208 2003/04/03 13:35:34 roberto Exp $
+** $Id: lparser.c,v 1.208a 2003/04/03 13:35:34 roberto Exp $
** Lua Parser
** See Copyright Notice in lua.h
*/
@@ -1141,11 +1141,15 @@ static void ifstat (LexState *ls, int line) {
static void localfunc (LexState *ls) {
expdesc v, b;
+ FuncState *fs = ls->fs;
new_localvar(ls, str_checkname(ls), 0);
- init_exp(&v, VLOCAL, ls->fs->freereg++);
+ init_exp(&v, VLOCAL, fs->freereg);
+ luaK_reserveregs(fs, 1);
adjustlocalvars(ls, 1);
body(ls, &b, 0, ls->linenumber);
- luaK_storevar(ls->fs, &v, &b);
+ luaK_storevar(fs, &v, &b);
+ /* debug information will only see the variable after this point! */
+ getlocvar(fs, fs->nactvar - 1).startpc = fs->pc;
}