From bc1b0733b808f02639ed79fff02f69f731636539 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sun, 1 Oct 2017 16:13:43 -0300 Subject: [PATCH] avoid the use of bit 'Bk' ('B' will lose this bit soon) --- lcode.c | 8 ++++---- lopcodes.h | 9 +++------ lvm.c | 8 ++++---- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/lcode.c b/lcode.c index 1f6e9c11..1331a54e 100644 --- a/lcode.c +++ b/lcode.c @@ -1,5 +1,5 @@ /* -** $Id: lcode.c,v 2.125 2017/09/26 18:14:45 roberto Exp roberto $ +** $Id: lcode.c,v 2.126 2017/09/28 16:53:29 roberto Exp roberto $ ** Code generator for Lua ** See Copyright Notice in lua.h */ @@ -1068,7 +1068,7 @@ static int isKstr (FuncState *fs, expdesc *e) { */ static int isKint (expdesc *e) { return (e->k == VKINT && !hasjumps(e) && - l_castS2U(e->u.ival) <= l_castS2U(MAXARG_C)); + l_castS2U(e->u.ival) <= l_castS2U(MAXARG_Cr)); } @@ -1178,8 +1178,8 @@ static void codebinexpval (FuncState *fs, OpCode op, v1 = luaK_exp2anyreg(fs, e1); } else { /* exchange operands to make 2nd one a constant */ - v2 = cast_int(e1->u.ival); - v1 = luaK_exp2anyreg(fs, e2) | BITRK; /* K bit signal the exchange */ + v2 = cast_int(e1->u.ival) | BITRK; /* K bit signal the exchange */ + v1 = luaK_exp2anyreg(fs, e2); } op = OP_ADDI; } diff --git a/lopcodes.h b/lopcodes.h index 6b9c3aeb..5aa75b16 100644 --- a/lopcodes.h +++ b/lopcodes.h @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.h,v 1.161 2017/09/26 18:14:45 roberto Exp roberto $ +** $Id: lopcodes.h,v 1.162 2017/09/28 16:53:29 roberto Exp roberto $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ @@ -73,6 +73,7 @@ enum OpMode {iABC, iABx, iAsBx, iAx}; /* basic instruction format */ #define MAXARG_A ((1<