harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r663517 - /harmony/enhanced/classlib/trunk/modules/archive/src/main/native/archive/shared/jclcrc32.c
Date Thu, 05 Jun 2008 10:30:54 GMT
Author: hindessm
Date: Thu Jun  5 03:30:54 2008
New Revision: 663517

URL: http://svn.apache.org/viewvc?rev=663517&view=rev
Log:
Throw exception in the event of a failure since the java code doesn't (at
least not immediately) check the return value.

Modified:
    harmony/enhanced/classlib/trunk/modules/archive/src/main/native/archive/shared/jclcrc32.c

Modified: harmony/enhanced/classlib/trunk/modules/archive/src/main/native/archive/shared/jclcrc32.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/archive/shared/jclcrc32.c?rev=663517&r1=663516&r2=663517&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/main/native/archive/shared/jclcrc32.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/main/native/archive/shared/jclcrc32.c
Thu Jun  5 03:30:54 2008
@@ -17,6 +17,7 @@
 
 #include "vmi.h"
 #include "zconf.h"
+#include "exceptions.h"
 
 uLong crc32 PROTOTYPE ((uLong crc, const Bytef * buf, uInt size));
 
@@ -29,8 +30,10 @@
   jlong result;
 
   b = ((*env)->GetPrimitiveArrayCritical (env, buf, 0));
-  if (b == NULL)
+  if (b == NULL) {
+    throwNewOutOfMemoryError(env, "");
     return -1;
+  }
   result = crc32 ((uLong) crc, (Bytef *) (b + off), (uInt) len);
   ((*env)->ReleasePrimitiveArrayCritical (env, buf, b, JNI_ABORT));
   return result;



Mime
View raw message