From 5608e04d323281a4c7e45eee1a9ca4b23437e0c5 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Fri, 26 Jul 2013 09:22:16 -0700 Subject: Fix AIOOBE in Method.compareParameters. Bug: 10032782 (cherry-picked from commit f700b73e492203ec773fb76d4525394ed3a1cc23) Change-Id: Id46690c1b3b08594cc8ad54f22f601b44d17841e --- libart/src/main/java/java/lang/reflect/Method.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libart/src/main/java/java/lang/reflect/Method.java b/libart/src/main/java/java/lang/reflect/Method.java index ce3d99e..00b51ad 100644 --- a/libart/src/main/java/java/lang/reflect/Method.java +++ b/libart/src/main/java/java/lang/reflect/Method.java @@ -254,7 +254,7 @@ public final class Method extends AbstractMethod implements GenericDeclaration, Dex dex = getDeclaringClass().getDex(); short[] types = dex.parameterTypeIndicesFromMethodIndex(methodDexIndex); int length = Math.min(types.length, params.length); - for (int i = 0; i < types.length; i++) { + for (int i = 0; i < length; i++) { Class aType = getDexCacheType(dex, types[i] & 0xFFFF); Class bType = params[i]; if (aType != bType) { -- cgit v1.1