private Code.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 Code.CatchHandler(typeIndexes, addresses, catchAllAddress, offset); }
private Code.CatchHandler[] adjustCatchHandlers(Code.CatchHandler[] catchHandlers) { if (catchHandlers == null || catchHandlers.length == 0) { return catchHandlers; } Code.CatchHandler[] adjustedCatchHandlers = new Code.CatchHandler[catchHandlers.length]; for (int i = 0; i < catchHandlers.length; ++i) { Code.CatchHandler catchHandler = catchHandlers[i]; int typeIndexesCount = catchHandler.typeIndexes.length; int[] adjustedTypeIndexes = new int[typeIndexesCount]; for (int j = 0; j < typeIndexesCount; ++j) { adjustedTypeIndexes[j] = adjustTypeIdIndex(catchHandler.typeIndexes[j]); } adjustedCatchHandlers[i] = new Code.CatchHandler( adjustedTypeIndexes, catchHandler.addresses, catchHandler.catchAllAddress, catchHandler.offset ); } return adjustedCatchHandlers; }
private Code.CatchHandler[] adjustCatchHandlers(Code.CatchHandler[] catchHandlers) { if (catchHandlers == null || catchHandlers.length == 0) { return catchHandlers; } Code.CatchHandler[] adjustedCatchHandlers = new Code.CatchHandler[catchHandlers.length]; for (int i = 0; i < catchHandlers.length; ++i) { Code.CatchHandler catchHandler = catchHandlers[i]; int typeIndexesCount = catchHandler.typeIndexes.length; int[] adjustedTypeIndexes = new int[typeIndexesCount]; for (int j = 0; j < typeIndexesCount; ++j) { adjustedTypeIndexes[j] = adjustTypeIdIndex(catchHandler.typeIndexes[j]); } adjustedCatchHandlers[i] = new Code.CatchHandler( adjustedTypeIndexes, catchHandler.addresses, catchHandler.catchAllAddress, catchHandler.offset ); } return adjustedCatchHandlers; }
private Code.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 Code.CatchHandler(typeIndexes, addresses, catchAllAddress, offset); }
private Code.CatchHandler[] adjustCatchHandlers(Code.CatchHandler[] catchHandlers) { if (catchHandlers == null || catchHandlers.length == 0) { return catchHandlers; } Code.CatchHandler[] adjustedCatchHandlers = new Code.CatchHandler[catchHandlers.length]; for (int i = 0; i < catchHandlers.length; ++i) { Code.CatchHandler catchHandler = catchHandlers[i]; int typeIndexesCount = catchHandler.typeIndexes.length; int[] adjustedTypeIndexes = new int[typeIndexesCount]; for (int j = 0; j < typeIndexesCount; ++j) { adjustedTypeIndexes[j] = adjustTypeIdIndex(catchHandler.typeIndexes[j]); } adjustedCatchHandlers[i] = new Code.CatchHandler( adjustedTypeIndexes, catchHandler.addresses, catchHandler.catchAllAddress, catchHandler.offset ); } return adjustedCatchHandlers; }