diff options
| -rw-r--r-- | lcode.c | 4 | ||||
| -rw-r--r-- | lopcodes.h | 3 | ||||
| -rw-r--r-- | ltests.c | 4 |
3 files changed, 6 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lcode.c,v 1.35 2000/06/12 13:52:05 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 1.36 2000/06/16 17:51:40 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 | */ |
| @@ -632,7 +632,7 @@ int luaK_code2 (FuncState *fs, OpCode o, int arg1, int arg2) { | |||
| 632 | } | 632 | } |
| 633 | 633 | ||
| 634 | 634 | ||
| 635 | const struct OpProperties luaK_opproperties[OP_SETLINE+1] = { | 635 | const struct OpProperties luaK_opproperties[NUM_OPCODES] = { |
| 636 | {iO, 0}, /* OP_END */ | 636 | {iO, 0}, /* OP_END */ |
| 637 | {iU, 0}, /* OP_RETURN */ | 637 | {iU, 0}, /* OP_RETURN */ |
| 638 | {iAB, 0}, /* OP_CALL */ | 638 | {iAB, 0}, /* OP_CALL */ |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lopcodes.h,v 1.62 2000/05/22 18:44:46 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.63 2000/06/05 14:56:18 roberto Exp roberto $ |
| 3 | ** Opcodes for Lua virtual machine | 3 | ** Opcodes for Lua virtual machine |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -152,6 +152,7 @@ OP_SETLINE/* U - - LINE=u */ | |||
| 152 | 152 | ||
| 153 | } OpCode; | 153 | } OpCode; |
| 154 | 154 | ||
| 155 | #define NUM_OPCODES ((int)OP_SETLINE+1) | ||
| 155 | 156 | ||
| 156 | 157 | ||
| 157 | #define ISJUMP(o) (OP_JMPNE <= (o) && (o) <= OP_JMP) | 158 | #define ISJUMP(o) (OP_JMPNE <= (o) && (o) <= OP_JMP) |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 1.24 2000/06/08 17:48:31 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.25 2000/06/12 13:52:05 roberto Exp roberto $ |
| 3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -50,7 +50,7 @@ static void setnameval (lua_Object t, const char *name, int val) { | |||
| 50 | */ | 50 | */ |
| 51 | 51 | ||
| 52 | 52 | ||
| 53 | static const char *const instrname[OP_SETLINE+1] = { | 53 | static const char *const instrname[NUM_OPCODES] = { |
| 54 | "END", "RETURN", "CALL", "TAILCALL", "PUSHNIL", "POP", "PUSHINT", | 54 | "END", "RETURN", "CALL", "TAILCALL", "PUSHNIL", "POP", "PUSHINT", |
| 55 | "PUSHSTRING", "PUSHNUM", "PUSHNEGNUM", "PUSHUPVALUE", "GETLOCAL", | 55 | "PUSHSTRING", "PUSHNUM", "PUSHNEGNUM", "PUSHUPVALUE", "GETLOCAL", |
| 56 | "GETGLOBAL", "GETTABLE", "GETDOTTED", "GETINDEXED", "PUSHSELF", | 56 | "GETGLOBAL", "GETTABLE", "GETDOTTED", "GETINDEXED", "PUSHSELF", |
