public static boolean isThrower(MethodDefinition md) { MethodBody body = md.getBody(); if(body == null) return false; for(Instruction inst : body.getInstructions()) { if(inst.hasLabel() || inst.getOpCode() == OpCode.RETURN || inst.getOpCode() == OpCode.ARETURN) return false; if(inst.getOpCode() == OpCode.ATHROW) return true; } // Actually should not go here for valid bytecode return false; }
@SuppressWarnings("ConstantConditions") private void remapJumps(final Map<Instruction, Instruction> remappedJumps) { for (final Instruction instruction : _instructions) { if (instruction.hasLabel()) { instruction.getLabel().setIndex(instruction.getOffset()); instruction.setOperand(newTarget); if (!newTarget.hasLabel()) { newTarget.setLabel(new com.strobel.assembler.metadata.Label(newTarget.getOffset())); final Instruction newDefault = mappedInstruction(remappedJumps, oldDefault); if (newDefault != null && !newDefault.hasLabel()) { newDefault.setLabel(new com.strobel.assembler.metadata.Label(newDefault.getOffset())); if (!newTarget.hasLabel()) { newTarget.setLabel(new com.strobel.assembler.metadata.Label(newTarget.getOffset()));
@SuppressWarnings("ConstantConditions") private void remapJumps(final Map<Instruction, Instruction> remappedJumps) { for (final Instruction instruction : _instructions) { if (instruction.hasLabel()) { instruction.getLabel().setIndex(instruction.getOffset()); instruction.setOperand(newTarget); if (!newTarget.hasLabel()) { newTarget.setLabel(new com.strobel.assembler.metadata.Label(newTarget.getOffset())); final Instruction newDefault = mappedInstruction(remappedJumps, oldDefault); if (newDefault != null && !newDefault.hasLabel()) { newDefault.setLabel(new com.strobel.assembler.metadata.Label(newDefault.getOffset())); if (!newTarget.hasLabel()) { newTarget.setLabel(new com.strobel.assembler.metadata.Label(newTarget.getOffset()));
@SuppressWarnings("ConstantConditions") private void remapJumps(final Map<Instruction, Instruction> remappedJumps) { for (final Instruction instruction : _instructions) { if (instruction.hasLabel()) { instruction.getLabel().setIndex(instruction.getOffset()); instruction.setOperand(newTarget); if (!newTarget.hasLabel()) { newTarget.setLabel(new com.strobel.assembler.metadata.Label(newTarget.getOffset())); final Instruction newDefault = mappedInstruction(remappedJumps, oldDefault); if (newDefault != null && !newDefault.hasLabel()) { newDefault.setLabel(new com.strobel.assembler.metadata.Label(newDefault.getOffset())); if (!newTarget.hasLabel()) { newTarget.setLabel(new com.strobel.assembler.metadata.Label(newTarget.getOffset()));
public void accept(final InstructionVisitor visitor) { if (hasLabel()) { visitor.visitLabel(_label);
public void accept(final InstructionVisitor visitor) { if (hasLabel()) { visitor.visitLabel(_label);
public void accept(final InstructionVisitor visitor) { if (hasLabel()) { visitor.visitLabel(_label);