summaryrefslogtreecommitdiffstats
path: root/runtime/jdwp
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2014-09-19 12:07:51 +0200
committerSebastien Hertz <shertz@google.com>2014-09-22 10:06:19 +0200
commita9aa0ffc2cf917be05749d1b27e7994249edb6d2 (patch)
tree68ce850e78061951359e9a292ef0215e408d507c /runtime/jdwp
parent5cdd0734d2f79eedc530f5f1e876cd2110e29c86 (diff)
downloadart-a9aa0ffc2cf917be05749d1b27e7994249edb6d2.zip
art-a9aa0ffc2cf917be05749d1b27e7994249edb6d2.tar.gz
art-a9aa0ffc2cf917be05749d1b27e7994249edb6d2.tar.bz2
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.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc
index d61660b..7c8c63c 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();