summaryrefslogtreecommitdiffstats
path: root/runtime/scoped_thread_state_change.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-05-08 14:19:26 -0700
committerMathieu Chartier <mathieuc@google.com>2015-05-08 15:09:17 -0700
commit50030ef998be09789da4a9a56738362852068f12 (patch)
tree02df1bd0954f9b970434d1363466b0cfe182bc12 /runtime/scoped_thread_state_change.h
parent6727a48193db2a0cf01af971cccffe1a6518c247 (diff)
downloadart-50030ef998be09789da4a9a56738362852068f12.tar.gz
art-50030ef998be09789da4a9a56738362852068f12.tar.bz2
art-50030ef998be09789da4a9a56738362852068f12.zip
Check IsReferenceVReg during deopt
Required since the quick GC maps may not agree with the verifier ones. Without this check we may copy stale object references into the shadow frame. (cherry picked from commit f00baf56ef647684888a407dbb6adadd704a2039) Bug: 20736048 Change-Id: I7783c8a8ee45cf601b08b4c38f1dec7f7d11380c
Diffstat (limited to 'runtime/scoped_thread_state_change.h')
-rw-r--r--runtime/scoped_thread_state_change.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/scoped_thread_state_change.h b/runtime/scoped_thread_state_change.h
index 99750a16d0..60ed55a914 100644
--- a/runtime/scoped_thread_state_change.h
+++ b/runtime/scoped_thread_state_change.h
@@ -133,6 +133,7 @@ class ScopedObjectAccessAlreadyRunnable {
T AddLocalReference(mirror::Object* obj) const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Locks::mutator_lock_->AssertSharedHeld(Self());
DCHECK(IsRunnable()); // Don't work with raw objects in non-runnable states.
+ DCHECK_NE(obj, Runtime::Current()->GetClearedJniWeakGlobal());
return obj == nullptr ? nullptr : Env()->AddLocalReference<T>(obj);
}