diff options
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 1.61 2001/02/08 11:19:10 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 1.62 2001/02/12 19:21:19 roberto Exp roberto $ |
3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -18,7 +18,7 @@ | |||
18 | #include "lparser.h" | 18 | #include "lparser.h" |
19 | 19 | ||
20 | 20 | ||
21 | void luaK_error (LexState *ls, const char *msg) { | 21 | void luaK_error (LexState *ls, const l_char *msg) { |
22 | luaX_error(ls, msg, ls->t.token); | 22 | luaX_error(ls, msg, ls->t.token); |
23 | } | 23 | } |
24 | 24 | ||
@@ -53,7 +53,7 @@ static void luaK_fixjump (FuncState *fs, int pc, int dest) { | |||
53 | else { /* jump is relative to position following jump instruction */ | 53 | else { /* jump is relative to position following jump instruction */ |
54 | int offset = dest-(pc+1); | 54 | int offset = dest-(pc+1); |
55 | if (abs(offset) > MAXARG_S) | 55 | if (abs(offset) > MAXARG_S) |
56 | luaK_error(fs->ls, "control structure too long"); | 56 | luaK_error(fs->ls, l_s("control structure too long")); |
57 | SETARG_S(*jmp, offset); | 57 | SETARG_S(*jmp, offset); |
58 | } | 58 | } |
59 | } | 59 | } |
@@ -99,7 +99,7 @@ void luaK_deltastack (FuncState *fs, int delta) { | |||
99 | fs->stacklevel += delta; | 99 | fs->stacklevel += delta; |
100 | if (fs->stacklevel > fs->f->maxstacksize) { | 100 | if (fs->stacklevel > fs->f->maxstacksize) { |
101 | if (fs->stacklevel > MAXSTACK) | 101 | if (fs->stacklevel > MAXSTACK) |
102 | luaK_error(fs->ls, "function or expression too complex"); | 102 | luaK_error(fs->ls, l_s("function or expression too complex")); |
103 | fs->f->maxstacksize = (short)fs->stacklevel; | 103 | fs->f->maxstacksize = (short)fs->stacklevel; |
104 | } | 104 | } |
105 | } | 105 | } |
@@ -119,7 +119,7 @@ static int number_constant (FuncState *fs, lua_Number r) { | |||
119 | if (f->knum[c] == r) return c; | 119 | if (f->knum[c] == r) return c; |
120 | /* not found; create a new entry */ | 120 | /* not found; create a new entry */ |
121 | luaM_growvector(fs->L, f->knum, fs->nknum, f->sizeknum, lua_Number, | 121 | luaM_growvector(fs->L, f->knum, fs->nknum, f->sizeknum, lua_Number, |
122 | MAXARG_U, "constant table overflow"); | 122 | MAXARG_U, l_s("constant table overflow")); |
123 | c = fs->nknum++; | 123 | c = fs->nknum++; |
124 | f->knum[c] = r; | 124 | f->knum[c] = r; |
125 | return c; | 125 | return c; |
@@ -436,11 +436,11 @@ static void codelineinfo (FuncState *fs) { | |||
436 | if (ls->lastline > fs->lastline) { | 436 | if (ls->lastline > fs->lastline) { |
437 | if (ls->lastline > fs->lastline+1) { | 437 | if (ls->lastline > fs->lastline+1) { |
438 | luaM_growvector(fs->L, f->lineinfo, fs->nlineinfo, f->sizelineinfo, int, | 438 | luaM_growvector(fs->L, f->lineinfo, fs->nlineinfo, f->sizelineinfo, int, |
439 | MAX_INT, "line info overflow"); | 439 | MAX_INT, l_s("line info overflow")); |
440 | f->lineinfo[fs->nlineinfo++] = -(ls->lastline - (fs->lastline+1)); | 440 | f->lineinfo[fs->nlineinfo++] = -(ls->lastline - (fs->lastline+1)); |
441 | } | 441 | } |
442 | luaM_growvector(fs->L, f->lineinfo, fs->nlineinfo, f->sizelineinfo, int, | 442 | luaM_growvector(fs->L, f->lineinfo, fs->nlineinfo, f->sizelineinfo, int, |
443 | MAX_INT, "line info overflow"); | 443 | MAX_INT, l_s("line info overflow")); |
444 | f->lineinfo[fs->nlineinfo++] = fs->pc; | 444 | f->lineinfo[fs->nlineinfo++] = fs->pc; |
445 | fs->lastline = ls->lastline; | 445 | fs->lastline = ls->lastline; |
446 | } | 446 | } |
@@ -660,7 +660,7 @@ int luaK_code2 (FuncState *fs, OpCode o, int arg1, int arg2) { | |||
660 | codelineinfo(fs); | 660 | codelineinfo(fs); |
661 | /* put new instruction in code array */ | 661 | /* put new instruction in code array */ |
662 | luaM_growvector(fs->L, f->code, fs->pc, f->sizecode, Instruction, | 662 | luaM_growvector(fs->L, f->code, fs->pc, f->sizecode, Instruction, |
663 | MAX_INT, "code size overflow"); | 663 | MAX_INT, l_s("code size overflow")); |
664 | f->code[fs->pc] = i; | 664 | f->code[fs->pc] = i; |
665 | return fs->pc++; | 665 | return fs->pc++; |
666 | } | 666 | } |