Fix IndexOutOfBoundsException

master
Graham 5 years ago
parent 8cac28ae99
commit 526b168925
  1. 12
      src/main/java/org/apache/harmony/pack200/ClassBands.java

@ -1027,11 +1027,13 @@ public class ClassBands extends BandSet {
} }
if(codeFlags.size() > 0) { if(codeFlags.size() > 0) {
long latestCodeFlag = ((Long)codeFlags.get(codeFlags.size() - 1)).longValue(); long latestCodeFlag = ((Long)codeFlags.get(codeFlags.size() - 1)).longValue();
int latestLocalVariableTableN = codeLocalVariableTableN.get(codeLocalVariableTableN.size() - 1); if (latestCodeFlag == (1 << 2)) {
if(latestCodeFlag == (1 << 2) && latestLocalVariableTableN == 0) { int latestLocalVariableTableN = codeLocalVariableTableN.get(codeLocalVariableTableN.size() - 1);
codeLocalVariableTableN.remove(codeLocalVariableTableN.size() - 1); if (latestLocalVariableTableN == 0) {
codeFlags.remove(codeFlags.size() - 1); codeLocalVariableTableN.remove(codeLocalVariableTableN.size() - 1);
codeFlags.add(new Long(0)); codeFlags.remove(codeFlags.size() - 1);
codeFlags.add(new Long(0));
}
} }
} }
} }

Loading…
Cancel
Save