From 40144cc022d321e2ec28d7fac2f5a24ba6714aff Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Tue, 29 Dec 2015 16:23:20 -0800 Subject: [PATCH] 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 --- runtime/debugger.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.11.0