aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/lcode.c b/lcode.c
index a11ca0e4..a34eed8e 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 1.97 2002/04/24 20:07:46 roberto Exp roberto $ 2** $Id: lcode.c,v 1.98 2002/05/06 15:51:41 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*/
@@ -23,11 +23,6 @@
23#define hasjumps(e) ((e)->t != (e)->f) 23#define hasjumps(e) ((e)->t != (e)->f)
24 24
25 25
26void luaK_error (LexState *ls, const char *msg) {
27 luaX_error(ls, msg, ls->t.token);
28}
29
30
31void luaK_nil (FuncState *fs, int from, int n) { 26void luaK_nil (FuncState *fs, int from, int n) {
32 Instruction *previous; 27 Instruction *previous;
33 if (fs->pc > fs->lasttarget && /* no jumps to current position? */ 28 if (fs->pc > fs->lasttarget && /* no jumps to current position? */
@@ -67,7 +62,7 @@ static void luaK_fixjump (FuncState *fs, int pc, int dest) {
67 else { /* jump is relative to position following jump instruction */ 62 else { /* jump is relative to position following jump instruction */
68 int offset = dest-(pc+1); 63 int offset = dest-(pc+1);
69 if (abs(offset) > MAXARG_sBx) 64 if (abs(offset) > MAXARG_sBx)
70 luaK_error(fs->ls, "control structure too long"); 65 luaX_syntaxerror(fs->ls, "control structure too long");
71 SETARG_sBx(*jmp, offset); 66 SETARG_sBx(*jmp, offset);
72 } 67 }
73} 68}
@@ -182,7 +177,7 @@ static void luaK_checkstack (FuncState *fs, int n) {
182 int newstack = fs->freereg + n; 177 int newstack = fs->freereg + n;
183 if (newstack > fs->f->maxstacksize) { 178 if (newstack > fs->f->maxstacksize) {
184 if (newstack >= MAXSTACK) 179 if (newstack >= MAXSTACK)
185 luaK_error(fs->ls, "function or expression too complex"); 180 luaX_syntaxerror(fs->ls, "function or expression too complex");
186 fs->f->maxstacksize = cast(lu_byte, newstack); 181 fs->f->maxstacksize = cast(lu_byte, newstack);
187 } 182 }
188} 183}