summaryrefslogtreecommitdiffstats
path: root/runtime/jni_internal.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-12-20 00:08:35 -0800
committerAndreas Gampe <agampe@google.com>2014-12-22 09:41:54 -0800
commita87630724ef4f8760684fa69c8ecc685735aff88 (patch)
tree516aae0158dae68f79504a66b5dc417c5817c510 /runtime/jni_internal.cc
parent6d1a047b4b3f9707d4ee1cc19e99717ee021ef48 (diff)
downloadart-a87630724ef4f8760684fa69c8ecc685735aff88.tar.gz
art-a87630724ef4f8760684fa69c8ecc685735aff88.tar.bz2
art-a87630724ef4f8760684fa69c8ecc685735aff88.zip
ART: Do not JNI abort on nullptr GetObjectRefType
A nullptr is a valid input, as it is different from a null reference. Bug: 18820997 Change-Id: Ibda8907ba13b20d2055049492a356ffdf4ddc714
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 4797e696d8..37ad46e209 100644
--- a/runtime/jni_internal.cc
+++ b/runtime/jni_internal.cc
@@ -2256,8 +2256,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);
@@ -2274,7 +2276,7 @@ class JNI {
return JNILocalRefType;
}
LOG(FATAL) << "IndirectRefKind[" << kind << "]";
- return JNIInvalidRefType;
+ UNREACHABLE();
}
private: