aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-04-18 16:48:24 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-04-18 16:48:24 -0300
commitf17e3624ef45212828458c9832306fefb7fc9a6b (patch)
treeb15e453c26d25ca0675adc2ba853cdebe8f59c46
parent2e9b8476cacf008e7313788e55e0b055fa4dee79 (diff)
downloadlua-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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lparser.c b/lparser.c
index 41ba802d..c7130dbf 100644
--- a/lparser.c
+++ b/lparser.c
@@ -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
1392static void localfunc (LexState *ls) { 1392static 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