Merge "ART: Add boot classpath check for initialization"
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 9fdfc92..1338cc9 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -240,6 +240,12 @@
ScopedLocalRef<jthrowable> cause(env, env->ExceptionOccurred());
CHECK(cause.get() != nullptr);
+ // Boot classpath classes should not fail initialization.
+ if (!Runtime::Current()->IsAotCompiler()) {
+ std::string tmp;
+ CHECK(klass->GetClassLoader() != nullptr) << klass->GetDescriptor(&tmp);
+ }
+
env->ExceptionClear();
bool is_error = env->IsInstanceOf(cause.get(), WellKnownClasses::java_lang_Error);
env->Throw(cause.get());