bug in gnu/kawa/functions/NumberCompare.java

Vladimir Tsichevski wowa@jet.msk.su
Mon Mar 17 10:11:00 GMT 2003


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



More information about the Kawa mailing list