diff options
Diffstat (limited to 'lparser.c')
| -rw-r--r-- | lparser.c | 7 |
1 files changed, 3 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lparser.c,v 2.33 2005/08/22 18:54:32 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.34 2005/08/24 17:41:10 roberto Exp $ |
| 3 | ** Lua Parser | 3 | ** Lua Parser |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -375,7 +375,7 @@ static void close_func (LexState *ls) { | |||
| 375 | FuncState *fs = ls->fs; | 375 | FuncState *fs = ls->fs; |
| 376 | Proto *f = fs->f; | 376 | Proto *f = fs->f; |
| 377 | removevars(ls, 0); | 377 | removevars(ls, 0); |
| 378 | luaK_codeABC(fs, OP_RETURN, 0, 1, 0); /* final return */ | 378 | luaK_ret(fs, 0, 0); /* final return */ |
| 379 | luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); | 379 | luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); |
| 380 | f->sizecode = fs->pc; | 380 | f->sizecode = fs->pc; |
| 381 | luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int); | 381 | luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int); |
| @@ -981,7 +981,6 @@ static int cond (LexState *ls) { | |||
| 981 | expdesc v; | 981 | expdesc v; |
| 982 | expr(ls, &v); /* read condition */ | 982 | expr(ls, &v); /* read condition */ |
| 983 | if (v.k == VNIL) v.k = VFALSE; /* `falses' are all equal here */ | 983 | if (v.k == VNIL) v.k = VFALSE; /* `falses' are all equal here */ |
| 984 | else if (v.k == VK) v.k = VTRUE; /* 'trues' too */ | ||
| 985 | luaK_goiftrue(ls->fs, &v); | 984 | luaK_goiftrue(ls->fs, &v); |
| 986 | return v.f; | 985 | return v.f; |
| 987 | } | 986 | } |
| @@ -1279,7 +1278,7 @@ static void retstat (LexState *ls) { | |||
| 1279 | } | 1278 | } |
| 1280 | } | 1279 | } |
| 1281 | } | 1280 | } |
| 1282 | luaK_codeABC(fs, OP_RETURN, first, nret+1, 0); | 1281 | luaK_ret(fs, first, nret); |
| 1283 | } | 1282 | } |
| 1284 | 1283 | ||
| 1285 | 1284 | ||
