From 1d66e88ea74f7d85f75db7f145fe955d5f0f6872 Mon Sep 17 00:00:00 2001 From: nikolay serdjuk Date: Mon, 7 Apr 2014 13:54:24 +0700 Subject: [PATCH] JDWP request is parsed incorrectly due to junk in the descriptor The ClassHelper object is created and deleted on the same line. Therefore it is wrong to refer to any class members of the object in the next line. Any references to the object and the object itself must have the same live ranges. Change-Id: I792d7baa3828b0389254f2941705e006cab092cd Signed-off-by: nikolay serdjuk --- runtime/debugger.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/debugger.cc b/runtime/debugger.cc index 2872a02e1..514ad4cb3 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -1217,7 +1217,8 @@ JDWP::JdwpError Dbg::SetArrayElements(JDWP::ObjectId array_id, int offset, int c LOG(WARNING) << __FUNCTION__ << " access out of bounds: offset=" << offset << "; count=" << count; return JDWP::ERR_INVALID_LENGTH; } - const char* descriptor = ClassHelper(dst->GetClass()).GetDescriptor(); + ClassHelper ch(dst->GetClass()); + const char* descriptor = ch.GetDescriptor(); JDWP::JdwpTag tag = BasicTagFromDescriptor(descriptor + 1); if (IsPrimitiveTag(tag)) { -- 2.11.0