diff options
author | Sebastien Hertz <shertz@google.com> | 2014-09-19 12:07:51 +0200 |
---|---|---|
committer | Sebastien Hertz <shertz@google.com> | 2014-09-22 10:06:19 +0200 |
commit | a9aa0ffc2cf917be05749d1b27e7994249edb6d2 (patch) | |
tree | 68ce850e78061951359e9a292ef0215e408d507c /runtime/jdwp | |
parent | 5cdd0734d2f79eedc530f5f1e876cd2110e29c86 (diff) | |
download | art-a9aa0ffc2cf917be05749d1b27e7994249edb6d2.tar.gz art-a9aa0ffc2cf917be05749d1b27e7994249edb6d2.tar.bz2 art-a9aa0ffc2cf917be05749d1b27e7994249edb6d2.zip |
Fix JDWP crash when reporting exception
The exception's throw location may be null so we need to handle that
case. Also fixes a memset issue.
Bug: 17571297
(cherry picked from commit bbb63897d7f2d99219cb50721fe530521e08ddff)
Change-Id: Iedebb58f9460c5f04913c269200e51161bda1ba9
Diffstat (limited to 'runtime/jdwp')
-rw-r--r-- | runtime/jdwp/jdwp_event.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc index d61660bca7..7c8c63ce46 100644 --- a/runtime/jdwp/jdwp_event.cc +++ b/runtime/jdwp/jdwp_event.cc @@ -1125,12 +1125,19 @@ bool JdwpState::PostException(const EventLocation* pThrowLoc, mirror::Throwable* DCHECK(exception_object != nullptr); DCHECK(pThrowLoc != nullptr); DCHECK(pCatchLoc != nullptr); - DCHECK(pThrowLoc->method != nullptr); - DCHECK_EQ(pThrowLoc->method->IsStatic(), thisPtr == nullptr); + if (pThrowLoc->method != nullptr) { + DCHECK_EQ(pThrowLoc->method->IsStatic(), thisPtr == nullptr); + } else { + VLOG(jdwp) << "Unexpected: exception event with empty throw location"; + } ModBasket basket; basket.pLoc = pThrowLoc; - basket.locationClass = pThrowLoc->method->GetDeclaringClass(); + if (pThrowLoc->method != nullptr) { + basket.locationClass = pThrowLoc->method->GetDeclaringClass(); + } else { + basket.locationClass = nullptr; + } basket.thread = Thread::Current(); basket.className = Dbg::GetClassName(basket.locationClass); basket.exceptionClass = exception_object->GetClass(); |