History

Lua 5.1-rc1

Lua Team committed 20 years ago

Commit 53d3c321 parent 27f2ec746 files · +1822 −1531Browse files

Showing the changes to src/lcode.c (1 of 46 files). Show all

Unified · Split

src/lcode.c+6−6
@@ -1,5 +1,5 @@
1/*1/*
2** $Id: lcode.c,v 2.22 2005/11/16 11:55:27 roberto Exp $2** $Id: lcode.c,v 2.24 2005/12/22 16:19:56 roberto Exp $
3** Code generator for Lua3** Code generator for Lua
4** See Copyright Notice in lua.h4** See Copyright Notice in lua.h
5*/5*/
@@ -196,7 +196,7 @@ void luaK_checkstack (FuncState *fs, int n) { · 190 unmodified lines
196 if (newstack > fs->f->maxstacksize) {196 if (newstack > fs->f->maxstacksize) {
197 if (newstack >= MAXSTACK)197 if (newstack >= MAXSTACK)
198 luaX_syntaxerror(fs->ls, "function or expression too complex");198 luaX_syntaxerror(fs->ls, "function or expression too complex");
199 fs->f->maxstacksize = cast(lu_byte, newstack);199 fs->f->maxstacksize = cast_byte(newstack);
200 }200 }
201}201}
202 202
@@ -227,11 +227,11 @@ static int addk (FuncState *fs, TValue *k, TValue *v) { · 24 unmodified lines
227 Proto *f = fs->f;227 Proto *f = fs->f;
228 int oldsize = f->sizek;228 int oldsize = f->sizek;
229 if (ttisnumber(idx)) {229 if (ttisnumber(idx)) {
230 lua_assert(luaO_rawequalObj(&fs->f->k[cast(int, nvalue(idx))], v));230 lua_assert(luaO_rawequalObj(&fs->f->k[cast_int(nvalue(idx))], v));
231 return cast(int, nvalue(idx));231 return cast_int(nvalue(idx));
232 }232 }
233 else { /* constant not found; create a new entry */233 else { /* constant not found; create a new entry */
234 setnvalue(idx, cast(lua_Number, fs->nk));234 setnvalue(idx, cast_num(fs->nk));
235 luaM_growvector(L, f->k, fs->nk, f->sizek, TValue,235 luaM_growvector(L, f->k, fs->nk, f->sizek, TValue,
236 MAXARG_Bx, "constant table overflow");236 MAXARG_Bx, "constant table overflow");
237 while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]);237 while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]);
@@ -647,7 +647,7 @@ static int constfolding (OpCode op, expdesc *e1, expdesc *e2) { · 409 unmodified lines
647 case OP_LEN: return 0; /* no constant folding for 'len' */647 case OP_LEN: return 0; /* no constant folding for 'len' */
648 default: lua_assert(0); r = 0; break;648 default: lua_assert(0); r = 0; break;
649 }649 }
650 if (r != r) return 0; /* do not attempt to produce NaN */650 if (luai_numisnan(r)) return 0; /* do not attempt to produce NaN */
651 e1->u.nval = r;651 e1->u.nval = r;
652 return 1;652 return 1;
653}653}