cbd8dae
diff -up frysk-0.4/frysk-sys/frysk/sys/cni/Errno.cxx.gccjint frysk-0.4/frysk-sys/frysk/sys/cni/Errno.cxx
cbd8dae
--- frysk-0.4/frysk-sys/frysk/sys/cni/Errno.cxx.gccjint	2010-03-29 17:19:01.000000000 -0400
cbd8dae
+++ frysk-0.4/frysk-sys/frysk/sys/cni/Errno.cxx	2010-03-29 17:22:06.000000000 -0400
cbd8dae
@@ -291,8 +291,15 @@ verifyBounds (jbyteArray bytes, jint sta
cbd8dae
     throw new java::lang::ArrayIndexOutOfBoundsException ();
cbd8dae
   if (length < 0)
cbd8dae
     throw new java::lang::ArrayIndexOutOfBoundsException ();
cbd8dae
-  if (start + length < 0)
cbd8dae
+#if 0
cbd8dae
+  jint end = start + length;
cbd8dae
+#else
cbd8dae
+  // Work around GCC bug where test for (MAX_INT+1)<0 fails - the
cbd8dae
+  // arrithmetic should have wrapped the value to -ve.
cbd8dae
+  long end = start + length;
cbd8dae
+#endif
cbd8dae
+  if (end < 0)
cbd8dae
     throw new java::lang::ArrayIndexOutOfBoundsException ();
cbd8dae
-  if (start + length > bytes->length)
cbd8dae
+  if (end > bytes->length)
cbd8dae
     throw new java::lang::ArrayIndexOutOfBoundsException ();
cbd8dae
 }