aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-06-21 14:05:49 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-06-21 14:05:49 -0300
commitf51775950737eb4d097cda0bba143973b5385947 (patch)
tree35b85b279cafa961591353a236b9da1c7d5a4920
parent52062684e11beffafbbbff0a8c7aa2642e40e47e (diff)
downloadlua-f51775950737eb4d097cda0bba143973b5385947.tar.gz
lua-f51775950737eb4d097cda0bba143973b5385947.tar.bz2
lua-f51775950737eb4d097cda0bba143973b5385947.zip
details
-rw-r--r--lcode.c4
-rw-r--r--lopcodes.h3
-rw-r--r--ltests.c4
3 files changed, 6 insertions, 5 deletions
diff --git a/lcode.c b/lcode.c
index e2a8dc94..6e43f499 100644
--- a/lcode.c
+++ b/lcode.c
@@ -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
635const struct OpProperties luaK_opproperties[OP_SETLINE+1] = { 635const 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 */
diff --git a/lopcodes.h b/lopcodes.h
index 6fd583a8..f98f562b 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -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)
diff --git a/ltests.c b/ltests.c
index 4a071fae..dd247b5b 100644
--- a/ltests.c
+++ b/ltests.c
@@ -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
53static const char *const instrname[OP_SETLINE+1] = { 53static 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",