TryCatchBlock tcBlock = new TryCatchBlock(); catches.add(tcBlock); int[] handlerAddrArr = handler.getAddresses(); for (int i = 0; i < handlerAddrArr.length; i++) { int addr = handlerAddrArr[i]; ClassInfo type = ClassInfo.fromDex(mth.dex(), handler.getTypeIndexes()[i]); tcBlock.addHandler(mth, addr, type); addrs.add(addr); handlersCount++; int addr = handler.getCatchAllAddress(); if (addr >= 0) { tcBlock.addHandler(mth, addr, null);
private void transformEncodedCatchHandler(Code.CatchHandler catchHandler, IndexMap indexMap) { int catchAllAddress = catchHandler.getCatchAllAddress(); int[] typeIndexes = catchHandler.getTypeIndexes(); int[] addresses = catchHandler.getAddresses(); if (catchAllAddress != -1) { codeOut.writeSleb128(-typeIndexes.length); } else { codeOut.writeSleb128(typeIndexes.length); } for (int i = 0; i < typeIndexes.length; i++) { codeOut.writeUleb128(indexMap.adjustType(typeIndexes[i])); codeOut.writeUleb128(addresses[i]); } if (catchAllAddress != -1) { codeOut.writeUleb128(catchAllAddress); } }
private void transformEncodedCatchHandler(Code.CatchHandler catchHandler, IndexMap indexMap) { int catchAllAddress = catchHandler.getCatchAllAddress(); int[] typeIndexes = catchHandler.getTypeIndexes(); int[] addresses = catchHandler.getAddresses(); if (catchAllAddress != -1) { codeOut.writeSleb128(-typeIndexes.length); } else { codeOut.writeSleb128(typeIndexes.length); } for (int i = 0; i < typeIndexes.length; i++) { codeOut.writeUleb128(indexMap.adjustType(typeIndexes[i])); codeOut.writeUleb128(addresses[i]); } if (catchAllAddress != -1) { codeOut.writeUleb128(catchAllAddress); } }
private void transformEncodedCatchHandler(Code.CatchHandler catchHandler, IndexMap indexMap) { int catchAllAddress = catchHandler.getCatchAllAddress(); int[] typeIndexes = catchHandler.getTypeIndexes(); int[] addresses = catchHandler.getAddresses(); if (catchAllAddress != -1) { codeOut.writeSleb128(-typeIndexes.length); } else { codeOut.writeSleb128(typeIndexes.length); } for (int i = 0; i < typeIndexes.length; i++) { codeOut.writeUleb128(indexMap.adjustType(typeIndexes[i])); codeOut.writeUleb128(addresses[i]); } if (catchAllAddress != -1) { codeOut.writeUleb128(catchAllAddress); } }
private int findCatchHandlerIndex(CatchHandler[] catchHandlers, int offset) { for (int i = 0; i < catchHandlers.length; i++) { CatchHandler catchHandler = catchHandlers[i]; if (catchHandler.getOffset() == offset) { return i; } } throw new IllegalArgumentException(); }
private int findCatchHandlerIndex(CatchHandler[] catchHandlers, int offset) { for (int i = 0; i < catchHandlers.length; i++) { CatchHandler catchHandler = catchHandlers[i]; if (catchHandler.getOffset() == offset) { return i; } } throw new IllegalArgumentException(); }
private CatchHandler readCatchHandler(int offset) { int size = readSleb128(); int handlersCount = Math.abs(size); int[] typeIndexes = new int[handlersCount]; int[] addresses = new int[handlersCount]; for (int i = 0; i < handlersCount; i++) { typeIndexes[i] = readUleb128(); addresses[i] = readUleb128(); } int catchAllAddress = size <= 0 ? readUleb128() : -1; return new CatchHandler(typeIndexes, addresses, catchAllAddress, offset); }
private CatchHandler readCatchHandler(int offset) { int size = readSleb128(); int handlersCount = Math.abs(size); int[] typeIndexes = new int[handlersCount]; int[] addresses = new int[handlersCount]; for (int i = 0; i < handlersCount; i++) { typeIndexes[i] = readUleb128(); addresses[i] = readUleb128(); } int catchAllAddress = size <= 0 ? readUleb128() : -1; return new CatchHandler(typeIndexes, addresses, catchAllAddress, offset); }
private int findCatchHandlerIndex(CatchHandler[] catchHandlers, int offset) { for (int i = 0; i < catchHandlers.length; i++) { CatchHandler catchHandler = catchHandlers[i]; if (catchHandler.getOffset() == offset) { return i; } } throw new IllegalArgumentException(); }
private CatchHandler readCatchHandler(int offset) { int size = readSleb128(); int handlersCount = Math.abs(size); int[] typeIndexes = new int[handlersCount]; int[] addresses = new int[handlersCount]; for (int i = 0; i < handlersCount; i++) { typeIndexes[i] = readUleb128(); addresses[i] = readUleb128(); } int catchAllAddress = size <= 0 ? readUleb128() : -1; return new CatchHandler(typeIndexes, addresses, catchAllAddress, offset); }