lua

A copy of the Lua development repository
Log | Files | Refs | README

commit c61bb89dbac0913cc28c775a58238403be75026f
parent 0bda88e6cd960d3b1ad1d46826bfdef179098d2a
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon, 17 May 2004 09:33:38 -0300

details

Diffstat:
Mlopcodes.h | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lopcodes.h b/lopcodes.h @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.h,v 1.106 2003/05/15 19:46:03 roberto Exp roberto $ +** $Id: lopcodes.h,v 1.107 2004/04/30 20:13:38 roberto Exp roberto $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ @@ -41,10 +41,10 @@ enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */ #define SIZE_OP 6 -#define POS_C SIZE_OP +#define POS_C (POS_A + SIZE_A) #define POS_B (POS_C + SIZE_C) #define POS_Bx POS_C -#define POS_A (POS_B + SIZE_B) +#define POS_A SIZE_OP /* @@ -79,7 +79,7 @@ enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */ #define GET_OPCODE(i) (cast(OpCode, (i)&MASK1(SIZE_OP,0))) #define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,0)) | cast(Instruction, o))) -#define GETARG_A(i) (cast(int, (i)>>POS_A)) +#define GETARG_A(i) (cast(int, (i)>>POS_A) & MASK1(SIZE_A,0)) #define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \ ((cast(Instruction, u)<<POS_A)&MASK1(SIZE_A,POS_A))))