@Nonnull private AnalyzedInstruction[] buildExceptionHandlerArray(@Nonnull TryBlock<? extends ExceptionHandler> tryBlock) { List<? extends ExceptionHandler> exceptionHandlers = tryBlock.getExceptionHandlers(); AnalyzedInstruction[] handlerInstructions = new AnalyzedInstruction[exceptionHandlers.size()]; for (int i=0; i<exceptionHandlers.size(); i++) { handlerInstructions[i] = analyzedInstructions.get(exceptionHandlers.get(i).getHandlerCodeAddress()); } return handlerInstructions; }
return handler.getHandlerCodeAddress(); String handlerType = handler.getExceptionType(); if (className.equals(handlerType)) { return handler.getHandlerCodeAddress();
int handlerAddress = handler.getHandlerCodeAddress(); if (handlerAddress >= codeSize) { throw new ExceptionWithContext(
tryBlocks.add(new BuilderTryBlock(startLabel, endLabel, (TypeReference) convertReference(exceptionHandler.getExceptionTypeReference()), newLabel(codeAddressToIndex, exceptionHandler.getHandlerCodeAddress())));
labelAssigner.getLabelAtAddress(handler.getHandlerCodeAddress()));
private void analyzeMoveException(@Nonnull AnalyzedInstruction analyzedInstruction) { int instructionAddress = getInstructionAddress(analyzedInstruction); RegisterType exceptionType = RegisterType.UNKNOWN_TYPE; for (TryBlock<? extends ExceptionHandler> tryBlock: methodImpl.getTryBlocks()) { for (ExceptionHandler handler: tryBlock.getExceptionHandlers()) { if (handler.getHandlerCodeAddress() == instructionAddress) { String type = handler.getExceptionType(); if (type == null) { exceptionType = RegisterType.getRegisterType(RegisterType.REFERENCE, classPath.getClass("Ljava/lang/Throwable;")); } else { exceptionType = RegisterType.getRegisterType(RegisterType.REFERENCE, classPath.getClass(type)) .merge(exceptionType); } } } } if (exceptionType.category == RegisterType.UNKNOWN) { throw new AnalysisException("move-exception must be the first instruction in an exception handler block"); } setDestinationRegisterTypeAndPropagateChanges(analyzedInstruction, exceptionType); }
DexlibAbstractInstruction instruction = instructionAtAddress(handler.getHandlerCodeAddress()); if (!(instruction instanceof MoveExceptionInstruction)) { logger.debug("" + String.format("First instruction of trap handler unit not MoveException but %s",
TypeKey exceptionTypeKey = classSection.getExceptionType(eh); int codeAddress = eh.getHandlerCodeAddress();
@Override public int getHandlerCodeAddress() { return exceptionHandler.getHandlerCodeAddress(); } }
@Override public int getHandlerCodeAddress() { return exceptionHandler.getHandlerCodeAddress(); } }
@Override public int getHandlerCodeAddress() { return exceptionHandler.getHandlerCodeAddress(); } }
@Nonnull private AnalyzedInstruction[] buildExceptionHandlerArray(@Nonnull TryBlock<? extends ExceptionHandler> tryBlock) { List<? extends ExceptionHandler> exceptionHandlers = tryBlock.getExceptionHandlers(); AnalyzedInstruction[] handlerInstructions = new AnalyzedInstruction[exceptionHandlers.size()]; for (int i=0; i<exceptionHandlers.size(); i++) { handlerInstructions[i] = analyzedInstructions.get(exceptionHandlers.get(i).getHandlerCodeAddress()); } return handlerInstructions; }
@Nonnull private AnalyzedInstruction[] buildExceptionHandlerArray(@Nonnull TryBlock<? extends ExceptionHandler> tryBlock) { List<? extends ExceptionHandler> exceptionHandlers = tryBlock.getExceptionHandlers(); AnalyzedInstruction[] handlerInstructions = new AnalyzedInstruction[exceptionHandlers.size()]; for (int i=0; i<exceptionHandlers.size(); i++) { handlerInstructions[i] = analyzedInstructions.get(exceptionHandlers.get(i).getHandlerCodeAddress()); } return handlerInstructions; }
@Override public boolean equals(@Nullable Object o) { if (o instanceof ExceptionHandler) { ExceptionHandler other = (ExceptionHandler)o; return Objects.equal(getExceptionType(), other.getExceptionType()) && (getHandlerCodeAddress() == other.getHandlerCodeAddress()); } return false; }
public static ImmutableExceptionHandler of(ExceptionHandler exceptionHandler) { if (exceptionHandler instanceof ImmutableExceptionHandler) { return (ImmutableExceptionHandler)exceptionHandler; } return new ImmutableExceptionHandler( exceptionHandler.getExceptionType(), exceptionHandler.getHandlerCodeAddress()); }
public static ImmutableExceptionHandler of(ExceptionHandler exceptionHandler) { if (exceptionHandler instanceof ImmutableExceptionHandler) { return (ImmutableExceptionHandler)exceptionHandler; } return new ImmutableExceptionHandler( exceptionHandler.getExceptionType(), exceptionHandler.getHandlerCodeAddress()); }
@Override public boolean equals(@Nullable Object o) { if (o instanceof ExceptionHandler) { ExceptionHandler other = (ExceptionHandler)o; return Objects.equal(getExceptionType(), other.getExceptionType()) && (getHandlerCodeAddress() == other.getHandlerCodeAddress()); } return false; }
@Override public boolean equals(@Nullable Object o) { if (o instanceof ExceptionHandler) { ExceptionHandler other = (ExceptionHandler)o; return Objects.equal(getExceptionType(), other.getExceptionType()) && (getHandlerCodeAddress() == other.getHandlerCodeAddress()); } return false; }
public static ImmutableExceptionHandler of(ExceptionHandler exceptionHandler) { if (exceptionHandler instanceof ImmutableExceptionHandler) { return (ImmutableExceptionHandler)exceptionHandler; } return new ImmutableExceptionHandler( exceptionHandler.getExceptionType(), exceptionHandler.getHandlerCodeAddress()); }
@Override public int compareTo(@Nonnull ExceptionHandler o) { int res; String exceptionType = getExceptionType(); if (exceptionType == null) { if (o.getExceptionType() != null) { return 1; } } else { String otherExceptionType = o.getExceptionType(); if (otherExceptionType == null) { return -1; } res = exceptionType.compareTo(o.getExceptionType()); if (res != 0) return res; } return Ints.compare(getHandlerCodeAddress(), o.getHandlerCodeAddress()); }