From fa005e09ee0631bc69f4244afea129a9c25373d1 Mon Sep 17 00:00:00 2001 From: hoenicke Date: Sun, 8 Jul 2001 14:35:06 +0000 Subject: [PATCH] * jode/bytecode/BytecodeInfo.java.in (calculateMaxStack): Handle special case for empty method. Previous code would just crash. git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1323 379699f6-c40d-0410-875b-85095c16579e --- jode/ChangeLog | 5 +++++ jode/jode/bytecode/BytecodeInfo.java.in | 5 +++++ 2 files changed, 10 insertions(+) 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();