History

Lua 5.0.1

Lua Team committed 22 years ago

Commit a985bf41 parent 488a64b15 files · +822 −155Browse files

Showing the changes to src/lparser.c (1 of 15 files). Show all

Unified · Split

src/lparser.c+7−3
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lparser.c,v 1.208 2003/04/03 13:35:34 roberto Exp $
2+** $Id: lparser.c,v 1.208a 2003/04/03 13:35:34 roberto Exp $
33 ** Lua Parser
44 ** See Copyright Notice in lua.h
55 */
@@ -1141,11 +1141,15 @@ static void ifstat (LexState *ls, int line) { · 1135 unmodified lines
11411141
11421142 static void localfunc (LexState *ls) {
11431143 expdesc v, b;
1144+ FuncState *fs = ls->fs;
11441145 new_localvar(ls, str_checkname(ls), 0);
1145− init_exp(&v, VLOCAL, ls->fs->freereg++);
1146+ init_exp(&v, VLOCAL, fs->freereg);
1147+ luaK_reserveregs(fs, 1);
11461148 adjustlocalvars(ls, 1);
11471149 body(ls, &b, 0, ls->linenumber);
1148− luaK_storevar(ls->fs, &v, &b);
1150+ luaK_storevar(fs, &v, &b);
1151+ /* debug information will only see the variable after this point! */
1152+ getlocvar(fs, fs->nactvar - 1).startpc = fs->pc;
11491153 }
11501154
11511155

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t