You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2006/06/02 18:22:01 UTC

svn commit: r411204 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/bytecode/CodeChunk.java

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.