aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-07-24 14:19:07 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-07-24 14:19:07 -0300
commit95988676d8f5ba05c83eda84e2e7369ae854b855 (patch)
treef92643c89f15e0dd6bccd283cce1b030b00b4ad2
parent767abdfdc0bb9c98d1f0cc6aac0cdc72d4713d65 (diff)
downloadlua-95988676d8f5ba05c83eda84e2e7369ae854b855.tar.gz
lua-95988676d8f5ba05c83eda84e2e7369ae854b855.tar.bz2
lua-95988676d8f5ba05c83eda84e2e7369ae854b855.zip
small bug when creating AsBc instructions in 16-bit machines
-rw-r--r--lcode.c4
-rw-r--r--lcode.h4
-rw-r--r--lopcodes.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/lcode.c b/lcode.c
index 9410eefa..252249b6 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 1.76 2001/06/15 20:36:57 roberto Exp roberto $ 2** $Id: lcode.c,v 1.77 2001/07/17 14:30:44 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*/
@@ -794,7 +794,7 @@ int luaK_codeABC (FuncState *fs, OpCode o, int a, int b, int c) {
794} 794}
795 795
796 796
797int luaK_codeABc (FuncState *fs, OpCode o, int a, int bc) { 797int luaK_codeABc (FuncState *fs, OpCode o, int a, unsigned int bc) {
798 lua_assert(getOpMode(o) == iABc || getOpMode(o) == iAsBc); 798 lua_assert(getOpMode(o) == iABc || getOpMode(o) == iAsBc);
799 return luaK_code(fs, CREATE_ABc(o, a, bc)); 799 return luaK_code(fs, CREATE_ABc(o, a, bc));
800} 800}
diff --git a/lcode.h b/lcode.h
index 82e77388..c2b87bff 100644
--- a/lcode.h
+++ b/lcode.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.h,v 1.22 2001/06/05 18:17:01 roberto Exp roberto $ 2** $Id: lcode.h,v 1.23 2001/06/12 14:36:48 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*/
@@ -39,7 +39,7 @@ typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_NOUNOPR } UnOpr;
39#define luaK_codeAsBc(fs,o,A,sBc) luaK_codeABc(fs,o,A,(sBc)+MAXARG_sBc) 39#define luaK_codeAsBc(fs,o,A,sBc) luaK_codeABc(fs,o,A,(sBc)+MAXARG_sBc)
40 40
41void luaK_error (LexState *ls, const l_char *msg); 41void luaK_error (LexState *ls, const l_char *msg);
42int luaK_codeABc (FuncState *fs, OpCode o, int A, int Bc); 42int luaK_codeABc (FuncState *fs, OpCode o, int A, unsigned int Bc);
43int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C); 43int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C);
44void luaK_nil (FuncState *fs, int from, int n); 44void luaK_nil (FuncState *fs, int from, int n);
45void luaK_reserveregs (FuncState *fs, int n); 45void luaK_reserveregs (FuncState *fs, int n);
diff --git a/lopcodes.h b/lopcodes.h
index 9abb5152..95b46692 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lopcodes.h,v 1.76 2001/06/28 19:58:57 roberto Exp roberto $ 2** $Id: lopcodes.h,v 1.77 2001/07/03 17:01:34 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*/
@@ -96,7 +96,7 @@ enum OpMode {iABC, iABc, iAsBc}; /* basic instruction format */
96 ((Instruction)(b)<<POS_Bc))) 96 ((Instruction)(b)<<POS_Bc)))
97 97
98#define GETARG_sBc(i) (GETARG_Bc(i)-MAXARG_sBc) 98#define GETARG_sBc(i) (GETARG_Bc(i)-MAXARG_sBc)
99#define SETARG_sBc(i,b) SETARG_Bc((i),(b)+MAXARG_sBc) 99#define SETARG_sBc(i,b) SETARG_Bc((i),(unsigned int)((b)+MAXARG_sBc))
100 100
101 101
102#define CREATE_ABC(o,a,b,c) ((Instruction)(o) \ 102#define CREATE_ABC(o,a,b,c) ((Instruction)(o) \