diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-07 14:36:56 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-07 14:36:56 -0300 |
| commit | dea6b6da9422f34ad91c8f6ad9ad3ed650e95713 (patch) | |
| tree | 3016b2fbcd67d75c71ee1b190aff2c24ada9b168 /lcode.c | |
| parent | 71144e3ff0cb81bd9b8bb56d94dc76074c638c64 (diff) | |
| download | lua-dea6b6da9422f34ad91c8f6ad9ad3ed650e95713.tar.gz lua-dea6b6da9422f34ad91c8f6ad9ad3ed650e95713.tar.bz2 lua-dea6b6da9422f34ad91c8f6ad9ad3ed650e95713.zip | |
new function `lua_vpushstr' to replace uses of `sprintf'
Diffstat (limited to 'lcode.c')
| -rw-r--r-- | lcode.c | 11 |
1 files changed, 3 insertions, 8 deletions
| @@ -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 | ||
| 26 | void luaK_error (LexState *ls, const char *msg) { | ||
| 27 | luaX_error(ls, msg, ls->t.token); | ||
| 28 | } | ||
| 29 | |||
| 30 | |||
| 31 | void luaK_nil (FuncState *fs, int from, int n) { | 26 | void 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 | } |
