Verifier sets class to error on hard error, resolved on soft.

This solves problems with the runtime finding classes that were rejected
by the verifier at compile time that end up passing at runtime. Before,
all classes that failed compile time verification were being set to
error, and now only classes that have hard errors should be set to
error.

Change-Id: I3a694d12ba4d6051b0310b21f8161f5aa62b43c3
diff --git a/src/class_linker.cc b/src/class_linker.cc
index cc44a9e..0f7ccad 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -2088,9 +2088,9 @@
   if (oat_file_class_status == Class::kStatusVerified || oat_file_class_status == Class::kStatusInitialized) {
     return true;
   }
-  if (oat_file_class_status == Class::kStatusError) {
-    // Compile time verification failed. Compile time verification can fail because we have
-    // incomplete type information. Consider the following:
+  if (oat_file_class_status == Class::kStatusResolved) {
+    // Compile time verification failed with a soft error. Compile time verification can fail
+    // because we have incomplete type information. Consider the following:
     // class ... {
     //   Foo x;
     //   .... () {
@@ -2108,6 +2108,11 @@
     // at compile time).
     return false;
   }
+  if (oat_file_class_status == Class::kStatusError) {
+    // Compile time verification failed with a hard error. This is caused by invalid instructions
+    // in the class. These errors are unrecoverable.
+    return false;
+  }
   if (oat_file_class_status == Class::kStatusNotReady) {
     // Status is uninitialized if we couldn't determine the status at compile time, for example,
     // not loading the class.