Fallback to quick in case of soft verification errors

Add a regression test: using uninitialized values triggers a soft
verification error and optimizing should not crash.

Thanks to Stephen Kyle (stephenckyle@googlemail.com) for the bug report.

Bug: 19988704
Change-Id: I67174538eed853baff735694b3ae8eb34afe2a39
diff --git a/compiler/dex/verified_method.h b/compiler/dex/verified_method.h
index 954cbf4..437ae52 100644
--- a/compiler/dex/verified_method.h
+++ b/compiler/dex/verified_method.h
@@ -70,6 +70,11 @@
   // by using the check-cast elision peephole optimization in the verifier.
   bool IsSafeCast(uint32_t pc) const;
 
+  // Returns true if there were any errors during verification.
+  bool HasVerificationFailures() const {
+    return has_verification_failures_;
+  }
+
  private:
   VerifiedMethod() = default;
 
@@ -107,6 +112,8 @@
   // dex PC to dex method index or dex field index based on the instruction.
   DequickenMap dequicken_map_;
   SafeCastSet safe_cast_set_;
+
+  bool has_verification_failures_;
 };
 
 }  // namespace art