This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

Re: Patch: FYI: jni.cc fixes


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))


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