Handle request for verification of a class is the error state.
This can happen if a subclass was verified first.
Change-Id: I4a6d301f19975b1da6a297c24c2cc7b614728151
diff --git a/src/class_linker.cc b/src/class_linker.cc
index b40449c..f6d555d 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -1939,13 +1939,19 @@
#endif
void ClassLinker::VerifyClass(Class* klass) {
+ // TODO: assert that the monitor on the Class is held
ObjectLock lock(klass);
- // TODO: assert that the monitor on the Class is held
if (klass->IsVerified()) {
return;
}
+ // The class might already be erroneous if we attempted to verify a subclass
+ if (klass->IsErroneous()) {
+ ThrowEarlierClassFailure(klass);
+ return;
+ }
+
CHECK_EQ(klass->GetStatus(), Class::kStatusResolved) << PrettyClass(klass);
klass->SetStatus(Class::kStatusVerifying);