From 9b7987a9d1471ba94764286b28e0998f73deb46a Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 11 Feb 2020 11:12:33 -0300 Subject: OP_LOADFALSE broken in two instructions --- lcode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lcode.c') diff --git a/lcode.c b/lcode.c index 332fdd00..35e0527f 100644 --- a/lcode.c +++ b/lcode.c @@ -872,9 +872,9 @@ static void discharge2anyreg (FuncState *fs, expdesc *e) { } -static int code_loadbool (FuncState *fs, int A, OpCode op, int jump) { +static int code_loadbool (FuncState *fs, int A, OpCode op) { luaK_getlabel(fs); /* those instructions may be jump targets */ - return luaK_codeABC(fs, op, A, jump, 0); + return luaK_codeABC(fs, op, A, 0, 0); } @@ -908,8 +908,8 @@ static void exp2reg (FuncState *fs, expdesc *e, int reg) { int p_t = NO_JUMP; /* position of an eventual LOAD true */ if (need_value(fs, e->t) || need_value(fs, e->f)) { int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs); - p_f = code_loadbool(fs, reg, OP_LOADFALSE, 1); /* skip next inst. */ - p_t = code_loadbool(fs, reg, OP_LOADTRUE, 0); + p_f = code_loadbool(fs, reg, OP_LFALSESKIP); /* skip next inst. */ + p_t = code_loadbool(fs, reg, OP_LOADTRUE); /* jump around these booleans if 'e' is not a test */ luaK_patchtohere(fs, fj); } -- cgit v1.2.3-55-g6feb