From d68ac700820f3e4253c8b4bcf718daf452f6da4c Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Tue, 11 Feb 2014 14:50:51 -0800 Subject: Add more checking to ReleasePrimitiveArray. When we ReleasePrimitiveArray, we now check that the elements pointer is not a heap address if it is not equal to the java array's data. Bug: 12845603 Change-Id: I458862f4dc586ba1c414647c7eb81b978c4ccb7e --- runtime/entrypoints/jni/jni_entrypoints.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/entrypoints/jni') diff --git a/runtime/entrypoints/jni/jni_entrypoints.cc b/runtime/entrypoints/jni/jni_entrypoints.cc index 4d1e531..c0304eb 100644 --- a/runtime/entrypoints/jni/jni_entrypoints.cc +++ b/runtime/entrypoints/jni/jni_entrypoints.cc @@ -46,7 +46,8 @@ extern "C" void* artFindNativeMethod() { } } -static void WorkAroundJniBugsForJobject(intptr_t* arg_ptr) { +static void WorkAroundJniBugsForJobject(intptr_t* arg_ptr) + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { intptr_t value = *arg_ptr; mirror::Object** value_as_jni_rep = reinterpret_cast(value); mirror::Object* value_as_work_around_rep = value_as_jni_rep != NULL ? *value_as_jni_rep : NULL; -- cgit v1.1