diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-04-18 16:48:24 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-04-18 16:48:24 -0300 |
| commit | f17e3624ef45212828458c9832306fefb7fc9a6b (patch) | |
| tree | b15e453c26d25ca0675adc2ba853cdebe8f59c46 | |
| parent | 2e9b8476cacf008e7313788e55e0b055fa4dee79 (diff) | |
| download | lua-f17e3624ef45212828458c9832306fefb7fc9a6b.tar.gz lua-f17e3624ef45212828458c9832306fefb7fc9a6b.tar.bz2 lua-f17e3624ef45212828458c9832306fefb7fc9a6b.zip | |
local function name only visible to debug info after being initialized
| -rw-r--r-- | lparser.c | 7 |
1 files changed, 6 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lparser.c,v 2.106 2011/02/14 16:36:34 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.107 2011/02/23 13:13:10 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 | */ |
| @@ -1391,9 +1391,14 @@ static void ifstat (LexState *ls, int line) { | |||
| 1391 | 1391 | ||
| 1392 | static void localfunc (LexState *ls) { | 1392 | static void localfunc (LexState *ls) { |
| 1393 | expdesc b; | 1393 | expdesc b; |
| 1394 | FuncState *fs = ls->fs; | ||
| 1395 | int varidx = fs->nactvar; /* index of new local variable */ | ||
| 1394 | new_localvar(ls, str_checkname(ls)); /* new local variable */ | 1396 | new_localvar(ls, str_checkname(ls)); /* new local variable */ |
| 1395 | adjustlocalvars(ls, 1); /* enter its scope */ | 1397 | adjustlocalvars(ls, 1); /* enter its scope */ |
| 1396 | body(ls, &b, 0, ls->linenumber); /* function created in next register */ | 1398 | body(ls, &b, 0, ls->linenumber); /* function created in next register */ |
| 1399 | lua_assert(b.k == VNONRELOC && b.u.ind.idx == varidx); | ||
| 1400 | /* debug information will only see the variable after this point! */ | ||
| 1401 | getlocvar(fs, varidx)->startpc = fs->pc; | ||
| 1397 | } | 1402 | } |
| 1398 | 1403 | ||
| 1399 | 1404 | ||
