summaryrefslogtreecommitdiff
path: root/runtime/native/java_lang_System.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2015-07-16 17:41:25 -0700
committer Andreas Gampe <agampe@google.com> 2015-07-16 17:41:25 -0700
commitc952ac905442a08b51af1f336f803fa221bd23d2 (patch)
tree1919b60412a0aaa50c1fe971d4f016e86a16ef67 /runtime/native/java_lang_System.cc
parent6d3d1e3d866a880b4df95ba96ed126c1723e3dd6 (diff)
ART: Fix System.arraycopy
We cannot use the same code for float+int and long+double. In debug mode, this will fail. Change-Id: Icf263626896a7b53e59685c474e77b4c3128ecd5
Diffstat (limited to 'runtime/native/java_lang_System.cc')
-rw-r--r--runtime/native/java_lang_System.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/native/java_lang_System.cc b/runtime/native/java_lang_System.cc
index 736b42b739..97aae67178 100644
--- a/runtime/native/java_lang_System.cc
+++ b/runtime/native/java_lang_System.cc
@@ -105,15 +105,21 @@ static void System_arraycopy(JNIEnv* env, jclass, jobject javaSrc, jint srcPos,
dstArray->AsShortSizedArray()->Memmove(dstPos, srcArray->AsShortSizedArray(), srcPos, count);
return;
case Primitive::kPrimInt:
- case Primitive::kPrimFloat:
DCHECK_EQ(Primitive::ComponentSize(dstComponentPrimitiveType), 4U);
dstArray->AsIntArray()->Memmove(dstPos, srcArray->AsIntArray(), srcPos, count);
return;
+ case Primitive::kPrimFloat:
+ DCHECK_EQ(Primitive::ComponentSize(dstComponentPrimitiveType), 4U);
+ dstArray->AsFloatArray()->Memmove(dstPos, srcArray->AsFloatArray(), srcPos, count);
+ return;
case Primitive::kPrimLong:
- case Primitive::kPrimDouble:
DCHECK_EQ(Primitive::ComponentSize(dstComponentPrimitiveType), 8U);
dstArray->AsLongArray()->Memmove(dstPos, srcArray->AsLongArray(), srcPos, count);
return;
+ case Primitive::kPrimDouble:
+ DCHECK_EQ(Primitive::ComponentSize(dstComponentPrimitiveType), 8U);
+ dstArray->AsDoubleArray()->Memmove(dstPos, srcArray->AsDoubleArray(), srcPos, count);
+ return;
case Primitive::kPrimNot: {
mirror::ObjectArray<mirror::Object>* dstObjArray = dstArray->AsObjectArray<mirror::Object>();
mirror::ObjectArray<mirror::Object>* srcObjArray = srcArray->AsObjectArray<mirror::Object>();