diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-10-09 14:56:23 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-10-09 14:56:23 -0300 |
| commit | a41d60e1d1f3a954648884d4ab7fb7e9ccdd52d6 (patch) | |
| tree | 59949e0ae6d791776e9f68a4019313093671e46b | |
| parent | f04fe526cd9de3e5460b614b2ff06268ad51872d (diff) | |
| download | lua-a41d60e1d1f3a954648884d4ab7fb7e9ccdd52d6.tar.gz lua-a41d60e1d1f3a954648884d4ab7fb7e9ccdd52d6.tar.bz2 lua-a41d60e1d1f3a954648884d4ab7fb7e9ccdd52d6.zip | |
debugger can only see `local function' after it has a meaningful value
| -rw-r--r-- | bugs | 14 | ||||
| -rw-r--r-- | lparser.c | 4 |
2 files changed, 14 insertions, 4 deletions
| @@ -561,11 +561,19 @@ local function d () end | |||
| 561 | 561 | ||
| 562 | patch = [[ | 562 | patch = [[ |
| 563 | * lparser.c: | 563 | * lparser.c: |
| 564 | 1145c1145,1146 | 564 | 1143a1144 |
| 565 | > FuncState *fs = ls->fs; | ||
| 566 | 1145c1146,1147 | ||
| 565 | < init_exp(&v, VLOCAL, ls->fs->freereg++); | 567 | < init_exp(&v, VLOCAL, ls->fs->freereg++); |
| 566 | --- | 568 | --- |
| 567 | > init_exp(&v, VLOCAL, ls->fs->freereg); | 569 | > init_exp(&v, VLOCAL, fs->freereg); |
| 568 | > luaK_reserveregs(ls->fs, 1); | 570 | > luaK_reserveregs(fs, 1); |
| 571 | 1148c1150,1152 | ||
| 572 | < luaK_storevar(ls->fs, &v, &b); | ||
| 573 | --- | ||
| 574 | > luaK_storevar(fs, &v, &b); | ||
| 575 | > /* debug information will only see the variable after this point! */ | ||
| 576 | > getlocvar(fs, fs->nactvar - 1).startpc = fs->pc; | ||
| 569 | ]], | 577 | ]], |
| 570 | 578 | ||
| 571 | } | 579 | } |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lparser.c,v 1.219 2003/09/29 16:41:35 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.220 2003/10/03 16:04:24 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 | */ |
| @@ -1172,6 +1172,8 @@ static void localfunc (LexState *ls) { | |||
| 1172 | adjustlocalvars(ls, 1); | 1172 | adjustlocalvars(ls, 1); |
| 1173 | body(ls, &b, 0, ls->linenumber); | 1173 | body(ls, &b, 0, ls->linenumber); |
| 1174 | luaK_storevar(fs, &v, &b); | 1174 | luaK_storevar(fs, &v, &b); |
| 1175 | /* debug information will only see the variable after this point! */ | ||
| 1176 | getlocvar(fs, fs->nactvar - 1).startpc = fs->pc; | ||
| 1175 | } | 1177 | } |
| 1176 | 1178 | ||
| 1177 | 1179 | ||
