summaryrefslogtreecommitdiffstats
path: root/runtime/jni_internal.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-12-22 17:55:51 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-12-22 17:55:51 +0000
commitadc5c3604e5c2801124d23cc87e75aeac1b3ec84 (patch)
tree08211737aca842ea62fe0029f3545b2e94e332c6 /runtime/jni_internal.cc
parent80f1a64eb84cec87c517a19b4f11cf704b8cba43 (diff)
parent2f9d7a5bf28e26d2f92128cf420a1ce9f9be0ef6 (diff)
downloadart-adc5c3604e5c2801124d23cc87e75aeac1b3ec84.tar.gz
art-adc5c3604e5c2801124d23cc87e75aeac1b3ec84.tar.bz2
art-adc5c3604e5c2801124d23cc87e75aeac1b3ec84.zip
am 2f9d7a5b: am 508d2665: Merge "ART: Do not JNI abort on nullptr GetObjectRefType"
* commit '2f9d7a5bf28e26d2f92128cf420a1ce9f9be0ef6': ART: Do not JNI abort on nullptr GetObjectRefType
Diffstat (limited to 'runtime/jni_internal.cc')
-rw-r--r--runtime/jni_internal.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/jni_internal.cc b/runtime/jni_internal.cc
index 658cb758a4..8c9a3b02ba 100644
--- a/runtime/jni_internal.cc
+++ b/runtime/jni_internal.cc
@@ -2255,8 +2255,10 @@ class JNI {
java_buffer, WellKnownClasses::java_nio_DirectByteBuffer_capacity));
}
- static jobjectRefType GetObjectRefType(JNIEnv* env, jobject java_object) {
- CHECK_NON_NULL_ARGUMENT_RETURN(java_object, JNIInvalidRefType);
+ static jobjectRefType GetObjectRefType(JNIEnv* env ATTRIBUTE_UNUSED, jobject java_object) {
+ if (java_object == nullptr) {
+ return JNIInvalidRefType;
+ }
// Do we definitely know what kind of reference this is?
IndirectRef ref = reinterpret_cast<IndirectRef>(java_object);
@@ -2273,7 +2275,7 @@ class JNI {
return JNILocalRefType;
}
LOG(FATAL) << "IndirectRefKind[" << kind << "]";
- return JNIInvalidRefType;
+ UNREACHABLE();
}
private: