diff options
Diffstat (limited to 'runtime/monitor.cc')
-rw-r--r-- | runtime/monitor.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/monitor.cc b/runtime/monitor.cc index d41d37e40a..1a80ded13d 100644 --- a/runtime/monitor.cc +++ b/runtime/monitor.cc @@ -1043,8 +1043,11 @@ void Monitor::VisitLocks(StackVisitor* stack_visitor, void (*callback)(mirror::O } uint16_t monitor_register = ((monitor_enter_instruction >> 8) & 0xff); - mirror::Object* o = reinterpret_cast<mirror::Object*>( - stack_visitor->GetVReg(m, monitor_register, kReferenceVReg)); + uint32_t value; + bool success = stack_visitor->GetVReg(m, monitor_register, kReferenceVReg, &value); + CHECK(success) << "Failed to read v" << monitor_register << " of kind " + << kReferenceVReg << " in method " << PrettyMethod(m); + mirror::Object* o = reinterpret_cast<mirror::Object*>(value); callback(o, callback_context); } } |