diff options
author | Mathieu Chartier <mathieuc@google.com> | 2015-05-08 14:19:26 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2015-05-08 15:09:17 -0700 |
commit | 50030ef998be09789da4a9a56738362852068f12 (patch) | |
tree | 02df1bd0954f9b970434d1363466b0cfe182bc12 /runtime/quick_exception_handler.cc | |
parent | 6727a48193db2a0cf01af971cccffe1a6518c247 (diff) | |
download | art-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/quick_exception_handler.cc')
-rw-r--r-- | runtime/quick_exception_handler.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc index a80eed6073..9e79bd20cb 100644 --- a/runtime/quick_exception_handler.cc +++ b/runtime/quick_exception_handler.cc @@ -223,7 +223,10 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { break; case kReferenceVReg: { uint32_t value = 0; - if (GetVReg(h_method.Get(), reg, kind, &value)) { + // Check IsReferenceVReg in case the compiled GC map doesn't agree with the verifier. + // We don't want to copy a stale reference into the shadow frame as a reference. + // b/20736048 + if (GetVReg(h_method.Get(), reg, kind, &value) && IsReferenceVReg(h_method.Get(), reg)) { new_frame->SetVRegReference(reg, reinterpret_cast<mirror::Object*>(value)); } else { new_frame->SetVReg(reg, kDeadValue); |