Avoid a case of eager initialization.
Don't mark as initialized classes that contain static field
initialization.
Change-Id: Iedcabbdf355e8861eb7731650eee1467f68ae0cd
diff --git a/src/runtime_support.cc b/src/runtime_support.cc
index 0ee9990..7b907ae 100644
--- a/src/runtime_support.cc
+++ b/src/runtime_support.cc
@@ -229,7 +229,7 @@
// we'd still be waiting for the lock.
if (fields_class->IsInitializing()) {
return resolved_field;
- } else if (Runtime::Current()->GetClassLinker()->EnsureInitialized(fields_class, true)) {
+ } else if (Runtime::Current()->GetClassLinker()->EnsureInitialized(fields_class, true, true)) {
return resolved_field;
} else {
DCHECK(self->IsExceptionPending()); // Throw exception and unwind
@@ -367,7 +367,7 @@
if (klass == referring_class && MethodHelper(referrer).IsClassInitializer()) {
return klass;
}
- if (!class_linker->EnsureInitialized(klass, true)) {
+ if (!class_linker->EnsureInitialized(klass, true, true)) {
CHECK(self->IsExceptionPending());
return NULL; // Failure - Indicate to caller to deliver exception
}