From 044879d39f7fee2b2b62259ae04abfa331504b03 Mon Sep 17 00:00:00 2001 From: Dan Bornstein Date: Wed, 16 Mar 2011 11:23:57 -0700 Subject: [PATCH] Correct the reported index. When asked to copy an incompatible reference, System.arraycopy() would complain about the nth element it was to copy, and not the absolute index of that element. Change-Id: I0f4a159b96fbedf083c3add57d2e20ee750d70fe --- vm/native/java_lang_System.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/native/java_lang_System.c b/vm/native/java_lang_System.c index 5402a7bbe..72ace573e 100644 --- a/vm/native/java_lang_System.c +++ b/vm/native/java_lang_System.c @@ -285,7 +285,7 @@ static void Dalvik_java_lang_System_arraycopy(const u4* args, JValue* pResult) if (copyCount != length) { dvmThrowExceptionFmt(gDvm.exArrayStoreException, "source[%d] of type %s cannot be stored in destination array of type %s", - copyCount, srcObj[copyCount]->clazz->descriptor, + srcPos + copyCount, srcObj[copyCount]->clazz->descriptor, dstClass->descriptor); RETURN_VOID(); } -- 2.11.0