From: =?UTF-8?q?Beno=C3=AEt=20Burnichon?= Date: Tue, 6 Dec 2011 14:25:18 +0100 Subject: [PATCH] Wrong code generation for some particular boolean expressions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comes from http://www.lua.org/bugs.html#5.1.4-9 reported by Thierry Van Elsuwe on 20 Jan 2011. Example: -- print((('hi' or true) and true) or true) --> hi (should be true) print(((nil and nil) or false) and true) --> nil (should be false) -- Signed-off-by: BenoƮt Burnichon --- src/lcode.c | 14 -------------- 1 files changed, 0 insertions(+), 14 deletions(-) diff --git a/src/lcode.c b/src/lcode.c index 84f286b..c13066e 100644 --- a/src/lcode.c +++ b/src/lcode.c @@ -549,13 +549,6 @@ void luaK_goiftrue (FuncState *fs, expdesc *e) { pc = e->u.s.info; break; } - case VFALSE: { - if (!hasjumps(e)) { - pc = luaK_jump(fs); /* always jump */ - break; - } - /* else go through */ - } default: { pc = jumponcond(fs, e, 0); break; @@ -579,13 +572,6 @@ static void luaK_goiffalse (FuncState *fs, expdesc *e) { pc = e->u.s.info; break; } - case VTRUE: { - if (!hasjumps(e)) { - pc = luaK_jump(fs); /* always jump */ - break; - } - /* else go through */ - } default: { pc = jumponcond(fs, e, 1); break;