harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r1002189 - /harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java
Date Tue, 28 Sep 2010 14:46:22 GMT
Author: sjanuary
Date: Tue Sep 28 14:46:22 2010
New Revision: 1002189

URL: http://svn.apache.org/viewvc?rev=1002189&view=rev
Log:
Pack200 - Fix for minor bug found when working in java 6 branch

Modified:
    harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java

Modified: harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java?rev=1002189&r1=1002188&r2=1002189&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java
Tue Sep 28 14:46:22 2010
@@ -438,14 +438,13 @@ public class BcBands extends BandSet {
             bcLabelRelativeOffsets.add(byteCodeOffset);
         }
         int padding = (byteCodeOffset + 1) % 4 == 0 ? 0 : 4 - ((byteCodeOffset + 1) % 4);
-        byteCodeOffset += padding + 8 + 8 * keys.length;
+        byteCodeOffset += 1 + padding + 8 + 8 * keys.length;
         updateRenumbering();
     }
 
     public void visitMethodInsn(int opcode, String owner, String name,
             String desc) {
         byteCodeOffset += 3;
-        updateRenumbering();
         switch (opcode) {
         case 182: // invokevirtual
         case 183: // invokespecial
@@ -495,11 +494,13 @@ public class BcBands extends BandSet {
             bcCodes.add(opcode);
             break;
         case 185: // invokeinterface
+            byteCodeOffset += 2;
             CPMethodOrField cpIMethod = cpBands.getCPIMethod(owner, name, desc);
             bcIMethodRef.add(cpIMethod);
             bcCodes.add(INVOKEINTERFACE);
             break;
         }
+        updateRenumbering();
     }
 
     public void visitMultiANewArrayInsn(String desc, int dimensions) {
@@ -522,7 +523,7 @@ public class BcBands extends BandSet {
             bcLabel.add(labels[i]);
             bcLabelRelativeOffsets.add(byteCodeOffset);
         }
-        int padding = (byteCodeOffset + 1) % 4 == 0 ? 0 : 4 - ((byteCodeOffset + 1) % 4);
+        int padding = byteCodeOffset % 4 == 0 ? 0 : 4 - (byteCodeOffset % 4);
         byteCodeOffset+= (padding + 12 + 4 * labels.length);
         updateRenumbering();
     }



Mime
View raw message