decompiler: removeLast helper to avoid possible errors
This commit is contained in:
@@ -81,6 +81,12 @@ public abstract class InstructionSequence {
|
||||
collinstr.remove(index);
|
||||
}
|
||||
|
||||
public void removeLast() {
|
||||
if (!collinstr.isEmpty()) {
|
||||
collinstr.remove(collinstr.size() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
public Instruction getCurrentInstr() {
|
||||
return collinstr.get(pointer);
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ public class DeadCodeHelper {
|
||||
Instruction instr = block.getLastInstruction();
|
||||
|
||||
if (instr != null && instr.opcode == CodeConstants.opc_goto) {
|
||||
block.getSeq().removeInstruction(block.getSeq().length() - 1);
|
||||
block.getSeq().removeLast();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -863,11 +863,11 @@ public class FinallyProcessor {
|
||||
|
||||
if ((type & 2) > 0) { // last
|
||||
if (finallytype == 0 || finallytype == 2) {
|
||||
seqPattern.removeInstruction(seqPattern.length() - 1);
|
||||
seqPattern.removeLast();
|
||||
}
|
||||
|
||||
if (finallytype == 2) {
|
||||
seqPattern.removeInstruction(seqPattern.length() - 1);
|
||||
seqPattern.removeLast();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1078,11 +1078,11 @@ public class FinallyProcessor {
|
||||
|
||||
if ((blocktype & 2) > 0) { // last
|
||||
if (finallytype == 2 || finallytype == 0) {
|
||||
seq.removeInstruction(seq.length() - 1);
|
||||
seq.removeLast();
|
||||
}
|
||||
|
||||
if (finallytype == 2) { // astore
|
||||
seq.removeInstruction(seq.length() - 1);
|
||||
seq.removeLast();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user