This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]