summaryrefslogtreecommitdiffstats
path: root/runtime/entrypoints/jni
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-02-11 14:50:51 -0800
committerMathieu Chartier <mathieuc@google.com>2014-02-11 15:05:31 -0800
commitd68ac700820f3e4253c8b4bcf718daf452f6da4c (patch)
treec4579acae2e9c807bdef4d8523124d9aed509075 /runtime/entrypoints/jni
parent6b3697fec487b355d107b693c965919bf5fff906 (diff)
downloadart-d68ac700820f3e4253c8b4bcf718daf452f6da4c.zip
art-d68ac700820f3e4253c8b4bcf718daf452f6da4c.tar.gz
art-d68ac700820f3e4253c8b4bcf718daf452f6da4c.tar.bz2
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
Diffstat (limited to 'runtime/entrypoints/jni')
-rw-r--r--runtime/entrypoints/jni/jni_entrypoints.cc3
1 files changed, 2 insertions, 1 deletions
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<mirror::Object**>(value);
mirror::Object* value_as_work_around_rep = value_as_jni_rep != NULL ? *value_as_jni_rep : NULL;