Don't read trace from VM during destroy VM.
Reading from the trace string during destroy VM leads to a read from freed
memory. Reorder predicates to avoid.
Change-Id: I5525e117b2a78ba2224160963259657e55a46ac8
diff --git a/src/check_jni.cc b/src/check_jni.cc
index 30d5099..f97e0b3 100644
--- a/src/check_jni.cc
+++ b/src/check_jni.cc
@@ -405,7 +405,7 @@
va_list ap;
const mirror::AbstractMethod* traceMethod = NULL;
- if ((!soa_.Vm()->trace.empty() || VLOG_IS_ON(third_party_jni)) && has_method_) {
+ if (has_method_ && (!soa_.Vm()->trace.empty() || VLOG_IS_ON(third_party_jni))) {
// We need to guard some of the invocation interface's calls: a bad caller might
// use DetachCurrentThread or GetEnv on a thread that's not yet attached.
Thread* self = Thread::Current();