From: tromey Date: Wed, 6 Nov 2002 14:14:51 +0000 (+0000) Subject: * jni.cc (array_from_valist): Assume that jlong won't be X-Git-Tag: upstream/4.9.2~83543 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99382f70675095d5eb97e47f8012b18e0a0cbc45;p=platform%2Fupstream%2Flinaro-gcc.git * jni.cc (array_from_valist): Assume that jlong won't be promoted. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58859 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 0ec5797..6a6adf9 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2002-11-06 Tom Tromey + + * jni.cc (array_from_valist): Assume that jlong won't be + promoted. + 2002-11-04 R. A. Rivas Diaz * gnu/java/security/provider/SHA.java (engineGetDigestLength): diff --git a/libjava/jni.cc b/libjava/jni.cc index 2985d47..9865ce4 100644 --- a/libjava/jni.cc +++ b/libjava/jni.cc @@ -693,7 +693,13 @@ array_from_valist (jvalue *values, JArray *arg_types, va_list vargs) { // 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 @@ array_from_valist (jvalue *values, JArray *arg_types, va_list vargs) 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))