[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Bug with logical operator or misunderstanding?
- From: "David J. Slate" <dslate@...>
- Date: Sat, 22 Jan 2011 13:09:54 -0600
Subject: Re: Bug with logical operator or misunderstanding?
Just wondering when the Lua (and LuaJIT) developers will address this
boolean expression evaluation error issue. Lua's a great language,
and I'm happily using LuaJIT-2.0.0-beta5 with beta5_hotfix1.patch.txt
as a drop-in replacement for Lua-5.1.4, but the fact that this error
occurs in such a syntactically and semantically simple expression
makes one wonder what other evaluation bugs may be lurking in what are
otherwise very reliable tools.
One would hope that fixing this bug would be a priority for finishing
up Lua-5.2 and LuaJIT-2.0.
-- Dave Slate
On Thu, 20 Jan 2011 16:27:41 -0500 Leo Razoumov <firstname.lastname@example.org> wrote:
> On Thu, Jan 20, 2011 at 11:11, Philipp Janda <email@example.com> wrote:
> > Am 20.01.2011 16:45, schrieb Michal Kottman:
> >> I guess this is a known bug - http://www.lua.org/bugs.html#5.1.4-3 .
> > Probably, but the given patch does not work for this case.
> > Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> >> print(((1 or false) and true) or false)
> > true
> >> print( (1 or 2) and true or false )
> > 1
> >> print(((1 or true) and true) or false)
> > 1
> > First test is from the bugs page and works correctly with the given
> > patch, second (and third) test is still wrong.
> > Philipp
> Confirmed. My Lua-5.1.4 is fully patched with
> and on Linux x86 (32 bits) I get:
> Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> > print(((1 or false) and true) or false)
> true -- correct
> > print(((1 or 2) and true) or false)
> 1 -- WRONG
> Seems that the patch http://www.lua.org/bugs.html#5.1.4-3 has not
> fixed the problem entirely.