diff options
Diffstat (limited to 'lparser.c')
-rw-r--r-- | lparser.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 2.56 2007/10/25 16:45:47 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.57 2008/04/02 17:19:22 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 | */ |
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | #define hasmultret(k) ((k) == VCALL || (k) == VVARARG) | 30 | #define hasmultret(k) ((k) == VCALL || (k) == VVARARG) |
31 | 31 | ||
32 | #define getlocvar(fs, i) ((fs)->f->locvars[(fs)->actvar[i]]) | 32 | #define getlocvar(fs, i) ((fs)->f->locvars[(fs)->actvar[i].idx]) |
33 | 33 | ||
34 | #define luaY_checklimit(fs,v,l,m) if ((v)>(l)) errorlimit(fs,l,m) | 34 | #define luaY_checklimit(fs,v,l,m) if ((v)>(l)) errorlimit(fs,l,m) |
35 | 35 | ||
@@ -161,8 +161,9 @@ static int registerlocalvar (LexState *ls, TString *varname) { | |||
161 | 161 | ||
162 | static void new_localvar (LexState *ls, TString *name, int n) { | 162 | static void new_localvar (LexState *ls, TString *name, int n) { |
163 | FuncState *fs = ls->fs; | 163 | FuncState *fs = ls->fs; |
164 | int reg = registerlocalvar(ls, name); | ||
164 | luaY_checklimit(fs, fs->nactvar+n+1, LUAI_MAXVARS, "local variables"); | 165 | luaY_checklimit(fs, fs->nactvar+n+1, LUAI_MAXVARS, "local variables"); |
165 | fs->actvar[fs->nactvar+n] = cast(unsigned short, registerlocalvar(ls, name)); | 166 | fs->actvar[fs->nactvar+n].idx = cast(unsigned short, reg); |
166 | } | 167 | } |
167 | 168 | ||
168 | 169 | ||