db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
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 GMT
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.



Mime
View raw message