Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 70620 invoked from network); 5 Jun 2008 10:31:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Jun 2008 10:31:16 -0000 Received: (qmail 79228 invoked by uid 500); 5 Jun 2008 10:31:19 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 79204 invoked by uid 500); 5 Jun 2008 10:31:19 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 79195 invoked by uid 99); 5 Jun 2008 10:31:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2008 03:31:19 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2008 10:30:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 64F2923889C2; Thu, 5 Jun 2008 03:30:55 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@harmony.apache.org From: hindessm@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080605103055.64F2923889C2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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;