OSDN Git Service

Don't throw OutOfMemoryError if it's already been thrown.
authorElliott Hughes <enh@google.com>
Thu, 17 Sep 2009 18:33:21 +0000 (11:33 -0700)
committerElliott Hughes <enh@google.com>
Thu, 17 Sep 2009 18:33:21 +0000 (11:33 -0700)
If GetPrimitiveArrayCritical fails, it throws a suitable exception for us.

Also remove dead code.

libcore/archive/src/main/native/java_util_zip_Deflater.c
libcore/openssl/src/main/native/BNInterface.c

index 47347e6..af0bfcc 100644 (file)
@@ -199,7 +199,6 @@ Java_java_util_zip_Deflater_deflateImpl (JNIEnv * env, jobject recv,
   sout = stream->stream->total_out;
   out = ((*env)->GetPrimitiveArrayCritical (env, buf, 0));
   if (out == NULL) {
-    throwNewOutOfMemoryError(env, "");
     return -1;
   }
   stream->stream->next_out = (Bytef *) out + off;
index 755a93b..1a3eb16 100644 (file)
 
 
 static void
-throwOutOfMemoryException(JNIEnv* env, const char* message)
-{
-    jniThrowException(env, "java/lang/OutOfMemoryError", message);
-}
-
-static void
 throwNewNullPointerException (JNIEnv* env, const char* message)
 {
     jniThrowException(env, "java/lang/NullPointerException", message);