Hi, all,

Here is a patch that fix broken jlongs on bigendian architectures.
It has been tested on Sparc and PowerPC platforms, and also works on x86.
This fix can be applied against release 0.07.


diff -u include/op_stack.h.ini include/op_stack.h
--- include/op_stack.h.ini      Mon Feb 22 11:49:14 1999
+++ include/op_stack.h  Mon Feb 22 12:05:19 1999
@@ -343,11 +343,11 @@
 
   assert (s != NULL);
 
-  val2.i = (jint)*(--s->stack_top);
-  val1.i = (jint)*(--s->stack_top);
+  val2.i = (juint)*(--s->stack_top);
+  val1.i = (juint)*(--s->stack_top);
 
-  *value = (jlong)val1.i << 32;
-  *value |= val2.j & 0xffffffff;
+  *value = (jlong)(juint)val1.i << 32;
+  *value |= (jlong)(juint)val2.i;
 
   JAVARLOG2(OPSTACK_LOG, 1, "    Popping long off operand stack %p, value is 
%ld\n", s, *value);
 }

I also have here working fixes for bigendian jbytes and jbooleans
(tested on PowerPC, and should also work for Sparc), but they are currently
too ugly to be proposed now. However, if someone is interested, feel free
to ask for them...

Hope this helps,

--Christophe

Reply via email to