diff options
author | Vladimir Marko <vmarko@google.com> | 2018-03-13 17:01:09 +0000 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2018-03-14 11:06:34 +0000 |
commit | fac21782ed87ce800813cfa0f9b4ee4bb4aac462 (patch) | |
tree | f14147d03574751cc2c153cf925354c722111177 /runtime/quick_exception_handler.cc | |
parent | 68f0680e83179cfe0127fda54a8e02a8552bf619 (diff) |
Fix delivering async exception while in compiled code.
Change artInstrumentationMethodExitFromCode() to check
for async exceptions.
Also fix kDebugExceptionDelivery = true causing stale
ObjPtr<> use.
Test: run-test --jit -runtime-option -Xjitthreshold:0 \
1934-jvmti-signal-thread
Test: Repeat with kDebugExceptionDelivery = true.
Bug: 74583459
Change-Id: Ia2e777cc3ccef4eba549aa290f8bc12608eafe44
Diffstat (limited to 'runtime/quick_exception_handler.cc')
-rw-r--r-- | runtime/quick_exception_handler.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc index 006405f095..077aa33925 100644 --- a/runtime/quick_exception_handler.cc +++ b/runtime/quick_exception_handler.cc @@ -143,14 +143,14 @@ class CatchBlockStackVisitor FINAL : public StackVisitor { void QuickExceptionHandler::FindCatch(ObjPtr<mirror::Throwable> exception) { DCHECK(!is_deoptimization_); + StackHandleScope<1> hs(self_); + Handle<mirror::Throwable> exception_ref(hs.NewHandle(exception)); if (kDebugExceptionDelivery) { - mirror::String* msg = exception->GetDetailMessage(); + ObjPtr<mirror::String> msg = exception_ref->GetDetailMessage(); std::string str_msg(msg != nullptr ? msg->ToModifiedUtf8() : ""); - self_->DumpStack(LOG_STREAM(INFO) << "Delivering exception: " << exception->PrettyTypeOf() + self_->DumpStack(LOG_STREAM(INFO) << "Delivering exception: " << exception_ref->PrettyTypeOf() << ": " << str_msg << "\n"); } - StackHandleScope<1> hs(self_); - Handle<mirror::Throwable> exception_ref(hs.NewHandle(exception)); // Walk the stack to find catch handler. CatchBlockStackVisitor visitor(self_, context_, &exception_ref, this); |