Make CheckJNI and JNI workarounds mutually exclusive...
...in the opposite direction; needing workarounds turns off CheckJNI.
This isn't necessarily a good idea, but I like the cleanup parts of
this change.
Change-Id: I708235ea3e5cc35ef90b01dd810e097e3ff9dd26
diff --git a/src/check_jni.cc b/src/check_jni.cc
index 8efdd1b..b39b521 100644
--- a/src/check_jni.cc
+++ b/src/check_jni.cc
@@ -198,7 +198,7 @@
* obj will be NULL. Otherwise, obj should always be non-NULL
* and valid.
*/
- if (obj != NULL && !Runtime::Current()->GetHeap()->IsHeapAddress(obj)) {
+ if (!Runtime::Current()->GetHeap()->IsHeapAddress(obj)) {
LOG(ERROR) << "JNI ERROR: field operation on invalid " << GetIndirectRefKind(java_object) << ": " << java_object;
JniAbort();
return;
@@ -739,7 +739,7 @@
ScopedJniThreadState ts(env_);
Object* o = Decode<Object*>(ts, java_object);
- if (o != NULL && !Runtime::Current()->GetHeap()->IsHeapAddress(o)) {
+ if (!Runtime::Current()->GetHeap()->IsHeapAddress(o)) {
// TODO: when we remove work_around_app_jni_bugs, this should be impossible.
LOG(ERROR) << "JNI ERROR: native code passing in reference to invalid " << GetIndirectRefKind(java_object) << ": " << java_object;
JniAbort();