From 41a71f3db62e5bccb162a2b18ed3801e00ff6f87 Mon Sep 17 00:00:00 2001 From: Sean Wan Date: Wed, 9 Jul 2014 12:08:29 -0700 Subject: [PATCH] CW on Master: Propagate or throw exception when no class found happens in interpreter. The old behavior is a check fail which causes zygote process crash. This is particular a problem for CW in which webview is not used, and this stops CW system start. Change-Id: I45f26d6e5d328de7f156793f9044f6bf3f878a1a --- runtime/interpreter/interpreter_common.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc index c7fb884fa..9f04b90c5 100644 --- a/runtime/interpreter/interpreter_common.cc +++ b/runtime/interpreter/interpreter_common.cc @@ -772,8 +772,13 @@ static void UnstartedRuntimeInvoke(Thread* self, MethodHelper& mh, // shadow_frame.GetMethod()->GetDeclaringClass()->GetClassLoader(); Class* found = Runtime::Current()->GetClassLinker()->FindClass( self, descriptor.c_str(), NullHandle()); - CHECK(found != NULL) << "Class.forName failed in un-started runtime for class: " - << PrettyDescriptor(descriptor); + if (found == NULL) { + if (!self->IsExceptionPending()) { + AbortTransaction(self, "Class.forName failed in un-started runtime for class: %s", + PrettyDescriptor(descriptor).c_str()); + } + return; + } result->SetL(found); } else if (name == "java.lang.Class java.lang.Void.lookupType()") { result->SetL(Runtime::Current()->GetClassLinker()->FindPrimitiveClass('V')); -- 2.11.0