This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
bug in gnu/kawa/functions/NumberCompare.java
- From: Vladimir Tsichevski <wowa at jet dot msk dot su>
- To: kawa at sources dot redhat dot com
- Date: Mon, 17 Mar 2003 13:09:49 +0300
- Subject: bug in gnu/kawa/functions/NumberCompare.java
Hi,
here is what I suppose is a bug. Compiling sentence like
(if (= 2 (invoke e 'getClickCount)) ...
got
Internal error while compiling display-tree.scm:146
java.lang.Error: emitGotoIfCompare2: logop must be one of ifeq...ifle,
got: 0
at gnu.bytecode.CodeAttr.emitGotoIfCompare2(CodeAttr.java:1302)
at gnu.kawa.functions.NumberCompare.compile(NumberCompare.java:255)
Same sentence with changed arg order compiles Ok:
(if (= (invoke e 'getClickCount) 2) ...
The trouble seemes to be in NumberCompare.java every time the arguments
of binary operation swapped, the operation mask is being transformed with:
mask ^= TRUE_IF_GRT|TRUE_IF_LSS;
this is wrong when arguments are compared for equality, so the sentence
should be changed to
if (mask != TRUE_IF_EQU)
mask ^= TRUE_IF_GRT|TRUE_IF_LSS;
Regards,
Vladimir