summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-10-09 14:56:23 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-10-09 14:56:23 -0300
commita41d60e1d1f3a954648884d4ab7fb7e9ccdd52d6 (patch)
tree59949e0ae6d791776e9f68a4019313093671e46b
parentf04fe526cd9de3e5460b614b2ff06268ad51872d (diff)
downloadlua-github-a41d60e1d1f3a954648884d4ab7fb7e9ccdd52d6.tar.gz
debugger can only see `local function' after it has a meaningful value
-rw-r--r--bugs14
-rw-r--r--lparser.c4
2 files changed, 14 insertions, 4 deletions
diff --git a/bugs b/bugs
index 4c4bedb3..fcd27215 100644
--- a/bugs
+++ b/bugs
@@ -561,11 +561,19 @@ local function d () end
patch = [[
* lparser.c:
-1145c1145,1146
+1143a1144
+> FuncState *fs = ls->fs;
+1145c1146,1147
< init_exp(&v, VLOCAL, ls->fs->freereg++);
---
-> init_exp(&v, VLOCAL, ls->fs->freereg);
-> luaK_reserveregs(ls->fs, 1);
+> init_exp(&v, VLOCAL, fs->freereg);
+> luaK_reserveregs(fs, 1);
+1148c1150,1152
+< 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;
]],
}
diff --git a/lparser.c b/lparser.c
index c565d140..cf0e18d1 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
/*
-** $Id: lparser.c,v 1.219 2003/09/29 16:41:35 roberto Exp roberto $
+** $Id: lparser.c,v 1.220 2003/10/03 16:04:24 roberto Exp roberto $
** Lua Parser
** See Copyright Notice in lua.h
*/
@@ -1172,6 +1172,8 @@ static void localfunc (LexState *ls) {
adjustlocalvars(ls, 1);
body(ls, &b, 0, ls->linenumber);
luaK_storevar(fs, &v, &b);
+ /* debug information will only see the variable after this point! */
+ getlocvar(fs, fs->nactvar - 1).startpc = fs->pc;
}