Tidying of the jweak fix.
Bug: 4260055
Change-Id: I1fd56f6c0ea1e2a7245fb2551daf2099bec99709
diff --git a/vm/CheckJni.cpp b/vm/CheckJni.cpp
index a09859b..fb66376 100644
--- a/vm/CheckJni.cpp
+++ b/vm/CheckJni.cpp
@@ -749,16 +749,14 @@
printWarn = true;
} else {
Object* obj = dvmDecodeIndirectRef(mEnv, jobj);
- if (obj != NULL) {
- if (obj == kInvalidIndirectRefObject) {
- LOGW("JNI WARNING: native code passing in invalid reference %p", jobj);
- printWarn = true;
- } else if (obj != kClearedJniWeakGlobal && !dvmIsValidObject(obj)) {
- // TODO: when we remove workAroundAppJniBugs, this should be impossible.
- LOGW("JNI WARNING: native code passing in reference to invalid object %p %p",
- jobj, obj);
- printWarn = true;
- }
+ if (obj == kInvalidIndirectRefObject) {
+ LOGW("JNI WARNING: native code passing in invalid reference %p", jobj);
+ printWarn = true;
+ } else if (obj != NULL && !dvmIsValidObject(obj)) {
+ // TODO: when we remove workAroundAppJniBugs, this should be impossible.
+ LOGW("JNI WARNING: native code passing in reference to invalid object %p %p",
+ jobj, obj);
+ printWarn = true;
}
}