Adjust exception range when appending instructions.

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1109 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
jochen 26 years ago
parent ad5a9f0194
commit 97bf664ac8
  1. 3
      jode/jode/bytecode/BytecodeInfo.java.in
  2. 11
      jode/jode/bytecode/Instruction.java

@ -148,7 +148,8 @@ public class BytecodeInfo extends BinaryInfo implements Opcodes {
// +((Instruction)o).getDescription() // +((Instruction)o).getDescription()
// +" after "+instr.prevByAddr // +" after "+instr.prevByAddr
// .getDescription()); // .getDescription());
instr.prevByAddr.appendInstruction((Instruction) o); instr.prevByAddr.appendInstruction((Instruction) o,
BytecodeInfo.this);
toRemove = null; toRemove = null;
} }

@ -509,13 +509,22 @@ public final class Instruction implements Opcodes{
} }
} }
void appendInstruction(Instruction newInstr) { void appendInstruction(Instruction newInstr, BytecodeInfo codeinfo) {
newInstr.addr = nextByAddr.addr; newInstr.addr = nextByAddr.addr;
newInstr.nextByAddr = nextByAddr; newInstr.nextByAddr = nextByAddr;
nextByAddr.prevByAddr = newInstr; nextByAddr.prevByAddr = newInstr;
newInstr.prevByAddr = this; newInstr.prevByAddr = this;
nextByAddr = newInstr; nextByAddr = newInstr;
/* adjust exception handlers end */
Handler[] handlers = codeinfo.getExceptionHandlers();
if (handlers != null) {
for (int i=0; i< handlers.length; i++) {
if (handlers[i].end == this)
handlers[i].end = newInstr;
}
}
} }
/** /**

Loading…
Cancel
Save