commit f51775950737eb4d097cda0bba143973b5385947
parent 52062684e11beffafbbbff0a8c7aa2642e40e47e
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Wed, 21 Jun 2000 14:05:27 -0300
details
Diffstat:
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/lcode.c b/lcode.c
@@ -1,5 +1,5 @@
/*
-** $Id: lcode.c,v 1.35 2000/06/12 13:52:05 roberto Exp roberto $
+** $Id: lcode.c,v 1.36 2000/06/16 17:51:40 roberto Exp roberto $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@@ -632,7 +632,7 @@ int luaK_code2 (FuncState *fs, OpCode o, int arg1, int arg2) {
}
-const struct OpProperties luaK_opproperties[OP_SETLINE+1] = {
+const struct OpProperties luaK_opproperties[NUM_OPCODES] = {
{iO, 0}, /* OP_END */
{iU, 0}, /* OP_RETURN */
{iAB, 0}, /* OP_CALL */
diff --git a/lopcodes.h b/lopcodes.h
@@ -1,5 +1,5 @@
/*
-** $Id: lopcodes.h,v 1.62 2000/05/22 18:44:46 roberto Exp roberto $
+** $Id: lopcodes.h,v 1.63 2000/06/05 14:56:18 roberto Exp roberto $
** Opcodes for Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -152,6 +152,7 @@ OP_SETLINE/* U - - LINE=u */
} OpCode;
+#define NUM_OPCODES ((int)OP_SETLINE+1)
#define ISJUMP(o) (OP_JMPNE <= (o) && (o) <= OP_JMP)
diff --git a/ltests.c b/ltests.c
@@ -1,5 +1,5 @@
/*
-** $Id: ltests.c,v 1.24 2000/06/08 17:48:31 roberto Exp roberto $
+** $Id: ltests.c,v 1.25 2000/06/12 13:52:05 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h
*/
@@ -50,7 +50,7 @@ static void setnameval (lua_Object t, const char *name, int val) {
*/
-static const char *const instrname[OP_SETLINE+1] = {
+static const char *const instrname[NUM_OPCODES] = {
"END", "RETURN", "CALL", "TAILCALL", "PUSHNIL", "POP", "PUSHINT",
"PUSHSTRING", "PUSHNUM", "PUSHNEGNUM", "PUSHUPVALUE", "GETLOCAL",
"GETGLOBAL", "GETTABLE", "GETDOTTED", "GETINDEXED", "PUSHSELF",