org.jf.dexlib2.Opcode.canThrow()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中org.jf.dexlib2.Opcode.canThrow()方法的一些代码示例,展示了Opcode.canThrow()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Opcode.canThrow()方法的具体详情如下:
包路径:org.jf.dexlib2.Opcode
类名称:Opcode
方法名:canThrow

Opcode.canThrow介绍

暂无

代码示例

代码示例来源:origin: JesusFreke/smali

private void addPredecessorSuccessor(@Nonnull AnalyzedInstruction predecessor,
                   @Nonnull AnalyzedInstruction successor,
                   @Nonnull AnalyzedInstruction[][] exceptionHandlers,
                   @Nonnull BitSet instructionsToProcess, boolean allowMoveException) {
  if (!allowMoveException && successor.instruction.getOpcode() == Opcode.MOVE_EXCEPTION) {
    throw new AnalysisException("Execution can pass from the " + predecessor.instruction.getOpcode().name +
        " instruction at code address 0x" + Integer.toHexString(getInstructionAddress(predecessor)) +
        " to the move-exception instruction at address 0x" +
        Integer.toHexString(getInstructionAddress(successor)));
  }
  if (!successor.addPredecessor(predecessor)) {
    return;
  }
  predecessor.addSuccessor(successor);
  instructionsToProcess.set(successor.getInstructionIndex());
  //if the successor can throw an instruction, then we need to add the exception handlers as additional
  //successors to the predecessor (and then apply this same logic recursively if needed)
  //Technically, we should handle the monitor-exit instruction as a special case. The exception is actually
  //thrown *after* the instruction executes, instead of "before" the instruction executes, lke for any other
  //instruction. But since it doesn't modify any registers, we can treat it like any other instruction.
  AnalyzedInstruction[] exceptionHandlersForSuccessor = exceptionHandlers[successor.instructionIndex];
  if (exceptionHandlersForSuccessor != null) {
    //the item for this instruction in exceptionHandlersForSuccessor should only be set if this instruction
    //can throw an exception
    assert successor.instruction.getOpcode().canThrow();
    for (AnalyzedInstruction exceptionHandler: exceptionHandlersForSuccessor) {
      addPredecessorSuccessor(predecessor, exceptionHandler, exceptionHandlers, instructionsToProcess, true);
    }
  }
}

代码示例来源:origin: JesusFreke/smali

if (currentTry != null && instructionOpcode.canThrow()) {
  exceptionHandlers[i] = currentExceptionHandlers;

代码示例来源:origin: wala/WALA

/**
 * True if the instruction can throw an exception
 * @see com.ibm.wala.shrikeBT.IInstruction#isPEI()
 */
public boolean isPEI() {
  return opcode.canThrow();
}

代码示例来源:origin: com.ibm.wala/com.ibm.wala.dalvik

/**
 * True if the instruction can throw an exception
 * @see com.ibm.wala.shrikeBT.IInstruction#isPEI()
 */
public boolean isPEI() {
  return opcode.canThrow();
}

代码示例来源:origin: org.smali/dexlib2

private void addPredecessorSuccessor(@Nonnull AnalyzedInstruction predecessor,
                   @Nonnull AnalyzedInstruction successor,
                   @Nonnull AnalyzedInstruction[][] exceptionHandlers,
                   @Nonnull BitSet instructionsToProcess, boolean allowMoveException) {
  if (!allowMoveException && successor.instruction.getOpcode() == Opcode.MOVE_EXCEPTION) {
    throw new AnalysisException("Execution can pass from the " + predecessor.instruction.getOpcode().name +
        " instruction at code address 0x" + Integer.toHexString(getInstructionAddress(predecessor)) +
        " to the move-exception instruction at address 0x" +
        Integer.toHexString(getInstructionAddress(successor)));
  }
  if (!successor.addPredecessor(predecessor)) {
    return;
  }
  predecessor.addSuccessor(successor);
  instructionsToProcess.set(successor.getInstructionIndex());
  //if the successor can throw an instruction, then we need to add the exception handlers as additional
  //successors to the predecessor (and then apply this same logic recursively if needed)
  //Technically, we should handle the monitor-exit instruction as a special case. The exception is actually
  //thrown *after* the instruction executes, instead of "before" the instruction executes, lke for any other
  //instruction. But since it doesn't modify any registers, we can treat it like any other instruction.
  AnalyzedInstruction[] exceptionHandlersForSuccessor = exceptionHandlers[successor.instructionIndex];
  if (exceptionHandlersForSuccessor != null) {
    //the item for this instruction in exceptionHandlersForSuccessor should only be set if this instruction
    //can throw an exception
    assert successor.instruction.getOpcode().canThrow();
    for (AnalyzedInstruction exceptionHandler: exceptionHandlersForSuccessor) {
      addPredecessorSuccessor(predecessor, exceptionHandler, exceptionHandlers, instructionsToProcess, true);
    }
  }
}

代码示例来源:origin: KB5201314/ZjDroid

private void addPredecessorSuccessor(@Nonnull AnalyzedInstruction predecessor,
                   @Nonnull AnalyzedInstruction successor,
                   @Nonnull AnalyzedInstruction[][] exceptionHandlers,
                   @Nonnull BitSet instructionsToProcess, boolean allowMoveException) {
  if (!allowMoveException && successor.instruction.getOpcode() == Opcode.MOVE_EXCEPTION) {
    throw new AnalysisException("Execution can pass from the " + predecessor.instruction.getOpcode().name +
        " instruction at code address 0x" + Integer.toHexString(getInstructionAddress(predecessor)) +
        " to the move-exception instruction at address 0x" +
        Integer.toHexString(getInstructionAddress(successor)));
  }
  if (!successor.addPredecessor(predecessor)) {
    return;
  }
  predecessor.addSuccessor(successor);
  instructionsToProcess.set(successor.getInstructionIndex());
  //if the successor can throw an instruction, then we need to add the exception handlers as additional
  //successors to the predecessor (and then apply this same logic recursively if needed)
  //Technically, we should handle the monitor-exit instruction as a special case. The exception is actually
  //thrown *after* the instruction executes, instead of "before" the instruction executes, lke for any other
  //instruction. But since it doesn't modify any registers, we can treat it like any other instruction.
  AnalyzedInstruction[] exceptionHandlersForSuccessor = exceptionHandlers[successor.instructionIndex];
  if (exceptionHandlersForSuccessor != null) {
    //the item for this instruction in exceptionHandlersForSuccessor should only be set if this instruction
    //can throw an exception
    assert successor.instruction.getOpcode().canThrow();
    for (AnalyzedInstruction exceptionHandler: exceptionHandlersForSuccessor) {
      addPredecessorSuccessor(predecessor, exceptionHandler, exceptionHandlers, instructionsToProcess, true);
    }
  }
}

代码示例来源:origin: KB5201314/ZjDroid

if (currentTry != null && instructionOpcode.canThrow()) {
  exceptionHandlers[i] = currentExceptionHandlers;

代码示例来源:origin: org.smali/dexlib2

if (currentTry != null && instructionOpcode.canThrow()) {
  exceptionHandlers[i] = currentExceptionHandlers;

相关文章