Insert a jump to end-of-method after a valued return, since try-catch analysis

needs it.
opc_return shouldn't occur in new bytecode interface


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1273 379699f6-c40d-0410-875b-85095c16579e
master
hoenicke 24 years ago
parent b14a4f5e86
commit 712f5d03dd
  1. 19
      jode/jode/decompiler/MethodAnalyzer.java
  2. 5
      jode/jode/decompiler/Opcodes.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);
}

@ -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();

Loading…
Cancel
Save