Showing the changes to src/lparser.c (1 of 15 files). Show all
Unified · Split
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 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 $ | |
| 3 | 3 | ** Lua Parser |
| 4 | 4 | ** See Copyright Notice in lua.h |
| 5 | 5 | */ |
| @@ -1141,11 +1141,15 @@ static void ifstat (LexState *ls, int line) { · 1135 unmodified lines | ||
| 1141 | 1141 | |
| 1142 | 1142 | static void localfunc (LexState *ls) { |
| 1143 | 1143 | expdesc v, b; |
| 1144 | + FuncState *fs = ls->fs; | |
| 1144 | 1145 | 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); | |
| 1146 | 1148 | adjustlocalvars(ls, 1); |
| 1147 | 1149 | 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; | |
| 1149 | 1153 | } |
| 1150 | 1154 | |
| 1151 | 1155 | |