Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 5997 invoked from network); 2 Jun 2006 16:22:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Jun 2006 16:22:23 -0000 Received: (qmail 32940 invoked by uid 500); 2 Jun 2006 16:22:23 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 32910 invoked by uid 500); 2 Jun 2006 16:22:22 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 32899 invoked by uid 99); 2 Jun 2006 16:22:22 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jun 2006 09:22:22 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jun 2006 09:22:22 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 5F78D1A983A; Fri, 2 Jun 2006 09:22:02 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r411204 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/CodeChunk.java Date: Fri, 02 Jun 2006 16:22:01 -0000 To: derby-commits@db.apache.org From: djd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060602162202.5F78D1A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: djd Date: Fri Jun 2 09:22:00 2006 New Revision: 411204 URL: http://svn.apache.org/viewvc?rev=411204&view=rev Log: Ensure sanity check on stack depth of a generated method is only invoked if the generated class is error free. Checks against an invalid class file format can cause unexpected errors as the constant pool index values may be corrupt. Fixes the lang/largeCodeGen.java test in sanity mode. Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/CodeChunk.java Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/CodeChunk.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/CodeChunk.java?rev=411204&r1=411203&r2=411204&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/CodeChunk.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/CodeChunk.java Fri Jun 2 09:22:00 2006 @@ -773,8 +773,11 @@ if (SanityManager.DEBUG) { - if (codeLength <= VMOpcode.MAX_CODE_LENGTH) - { + // Only validate if the class file format is valid. + // Ok code length and guaranteed no errors building the class. + if ((codeLength <= VMOpcode.MAX_CODE_LENGTH) + && (mb != null && mb.cb.limitMsg == null)) + { // Validate the alternate way to calculate the // max stack agrees with the dynamic as the code // is built way.