summaryrefslogtreecommitdiff
path: root/runtime/quick_exception_handler.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-05-08 23:19:41 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-05-08 23:19:41 +0000
commit0172c5b0a4baae0c1eb05555dabf56bc4c08f5b0 (patch)
tree40215f423ff902edab3430e5c994e95659b91278 /runtime/quick_exception_handler.cc
parent2c68641c0f0d8fb410cf73182acb4e498c0e558f (diff)
parent50030ef998be09789da4a9a56738362852068f12 (diff)
Merge "Check IsReferenceVReg during deopt"
Diffstat (limited to 'runtime/quick_exception_handler.cc')
-rw-r--r--runtime/quick_exception_handler.cc5
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);