diff --git a/jode/ChangeLog b/jode/ChangeLog index 8d9b520..128485c 100644 --- a/jode/ChangeLog +++ b/jode/ChangeLog @@ -1,3 +1,8 @@ +2001-07-08 Jochen Hoenicke + + * jode/bytecode/BytecodeInfo.java.in (calculateMaxStack): Handle + special case for empty method. Previous code would just crash. + 2001-06-15 Jochen Hoenicke * jode/jvm/SyntheticAnalyzer.java.in: diff --git a/jode/jode/bytecode/BytecodeInfo.java.in b/jode/jode/bytecode/BytecodeInfo.java.in index 5bdd291..fbfae83 100644 --- a/jode/jode/bytecode/BytecodeInfo.java.in +++ b/jode/jode/bytecode/BytecodeInfo.java.in @@ -920,6 +920,11 @@ public class BytecodeInfo extends BinaryInfo implements Opcodes { private void calculateMaxStack() { maxStack = 0; + + if (instructions.getCodeLength() == 0) + /* This is an empty method; the code below would crash */ + return; + int[] stackHeights = new int[instructions.getCodeLength()]; int[] poppush = new int[2]; Stack todo = new Stack();