+2001-04-27 Tom Tromey <tromey@redhat.com>
+
+ * jni.cc (_Jv_JNI_GetPrimitiveArrayRegion): Fixed bounds
+ checking.
+ (_Jv_JNI_SetPrimitiveArrayRegion): Likewise.
+
2001-04-27 Martin Kahlert <martin.kahlert@infineon.com>
* include/jni.h (struct JNINativeInterface): Fixed types in
Get/Set*ArrayRegion declarations.
(class _Jv_JNIEnv): Likewise.
-2001-04-25 Bryce McKinlay <bryce@albatross.co.nz>
+2001-04-26 Alexandre Oliva <aoliva@redhat.com>
* configure.in: Obtain THREADS with `gcc -v'.
* configure: Rebuilt.
jsize start, jsize len,
T *buf)
{
- if (start < 0 || len >= array->length || start + len >= array->length)
+ // The cast to unsigned lets us save a comparison.
+ if (start < 0 || len < 0
+ || (unsigned long) (start + len) >= (unsigned long) array->length)
{
try
{
_Jv_JNI_SetPrimitiveArrayRegion (JNIEnv *env, JArray<T> *array,
jsize start, jsize len, T *buf)
{
- if (start < 0 || len >= array->length || start + len >= array->length)
+ // The cast to unsigned lets us save a comparison.
+ if (start < 0 || len < 0
+ || (unsigned long) (start + len) >= (unsigned long) array->length)
{
try
{
{
try
{
- return _Jv_MonitorEnter (obj);
+ _Jv_MonitorEnter (obj);
+ return 0;
}
catch (jthrowable t)
{
{
try
{
- return _Jv_MonitorExit (obj);
+ _Jv_MonitorExit (obj);
+ return 0;
}
catch (jthrowable t)
{