diff --git a/jode/jode/decompiler/MethodAnalyzer.java b/jode/jode/decompiler/MethodAnalyzer.java index 4594487..b37680e 100644 --- a/jode/jode/decompiler/MethodAnalyzer.java +++ b/jode/jode/decompiler/MethodAnalyzer.java @@ -478,12 +478,19 @@ public class MethodAnalyzer implements Scope, ClassDeclarer { Opcodes.addOpcode(flows[i], instr, this); } Block[] succs = blocks[i].getSuccs(); - FlowBlock[] flowSuccs = new FlowBlock[succs.length]; - for (int j=0; j< succs.length; j++) { - if (succs[j] == null) - flowSuccs[j] = FlowBlock.END_OF_METHOD; - else - flowSuccs[j] = flows[succs[j].getBlockNr()]; + FlowBlock[] flowSuccs; + int lastOpcode = blocks[i].getInstructions()[last].getOpcode(); + if (lastOpcode >= Opcodes.opc_ireturn + && lastOpcode <= Opcodes.opc_areturn) { + flowSuccs = new FlowBlock[] { FlowBlock.END_OF_METHOD }; + } else { + flowSuccs = new FlowBlock[succs.length]; + for (int j=0; j< succs.length; j++) { + if (succs[j] == null) + flowSuccs[j] = FlowBlock.END_OF_METHOD; + else + flowSuccs[j] = flows[succs[j].getBlockNr()]; + } } flows[i].setSuccessors(flowSuccs); } diff --git a/jode/jode/decompiler/Opcodes.java b/jode/jode/decompiler/Opcodes.java index 63ef253..29b99a5 100644 --- a/jode/jode/decompiler/Opcodes.java +++ b/jode/jode/decompiler/Opcodes.java @@ -338,9 +338,8 @@ public abstract class Opcodes implements jode.bytecode.Opcodes { break; } case opc_return: - flow.appendBlock(createBlock - (ma, instr, new ReturnBlock())); - break; + throw new InternalError("opc_return no longer allowed"); + case opc_getstatic: case opc_getfield: { Reference ref = instr.getReference();