This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: FYI: jni.cc fixes
- From: Tom Tromey <tromey at redhat dot com>
- To: "Ulrich Weigand" <Ulrich dot Weigand at de dot ibm dot com>
- Cc: java-patches at gcc dot gnu dot org
- Date: 06 Nov 2002 07:07:36 -0700
- Subject: Re: Patch: FYI: jni.cc fixes
- References: <OFDF80E533.3089D430-ONC1256C67.006702D6@de.ibm.com>
- Reply-to: tromey at redhat dot com
Ulrich> This causes a test case failure on s390-ibm-linux
I'm checking this in.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* jni.cc (array_from_valist): Assume that jlong won't be
promoted.
Index: jni.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni.cc,v
retrieving revision 1.64
diff -u -r1.64 jni.cc
--- jni.cc 23 Oct 2002 23:19:55 -0000 1.64
+++ jni.cc 6 Nov 2002 14:13:29 -0000
@@ -693,7 +693,13 @@
{
// Here we assume that sizeof(int) >= sizeof(jint), because we
// use `int' when decoding the varargs. Likewise for
- // long/jlong, float, and double.
+ // float, and double. Also we assume that sizeof(jlong) >=
+ // sizeof(int), i.e. that jlong values are not further
+ // promoted.
+ JvAssert (sizeof (int) >= sizeof (jint));
+ JvAssert (sizeof (jlong) >= sizeof (int));
+ JvAssert (sizeof (double) >= sizeof (jfloat));
+ JvAssert (sizeof (double) >= sizeof (jdouble));
if (arg_elts[i] == JvPrimClass (byte))
values[i].b = (jbyte) va_arg (vargs, int);
else if (arg_elts[i] == JvPrimClass (short))
@@ -701,7 +707,7 @@
else if (arg_elts[i] == JvPrimClass (int))
values[i].i = (jint) va_arg (vargs, int);
else if (arg_elts[i] == JvPrimClass (long))
- values[i].j = (jlong) va_arg (vargs, long);
+ values[i].j = (jlong) va_arg (vargs, jlong);
else if (arg_elts[i] == JvPrimClass (float))
values[i].f = (jfloat) va_arg (vargs, double);
else if (arg_elts[i] == JvPrimClass (double))