From: Andreas Gampe Date: Wed, 30 Dec 2015 00:23:20 +0000 (-0800) Subject: ART: Fix JDWP GetClassLoader command X-Git-Tag: android-x86-7.1-r1~839^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=40144cc022d321e2ec28d7fac2f5a24ba6714aff;p=android-x86%2Fart.git ART: Fix JDWP GetClassLoader command The command is spec-ed to take a type, and return the type's classloader. The input is thus already a Class, not a generic Object. Fix the implementation to not always return null. Bug: 26349019 Change-Id: I4aa075902f4a112624edc644d3540a59eea057c8 --- diff --git a/runtime/debugger.cc b/runtime/debugger.cc index e0211f5e3..f009fe6ac 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -730,7 +730,8 @@ JDWP::JdwpError Dbg::GetClassLoader(JDWP::RefTypeId id, JDWP::ExpandBuf* pReply) if (o == nullptr) { return JDWP::ERR_INVALID_OBJECT; } - expandBufAddObjectId(pReply, gRegistry->Add(o->GetClass()->GetClassLoader())); + DCHECK(o->IsClass()); + expandBufAddObjectId(pReply, gRegistry->Add(o->AsClass()->GetClassLoader())); return JDWP::ERR_NONE; }