Fix for interpreter crash on new instance of class

Rationale:
Fuzz testing found divergences between the compiler and interpreter
which turned out to be caused by calling instance on java.lang.Class
(this worked for compiler but crashed interpeter). Since RI does not
allow this construct, solution is to force interpreter in this
unlikely case and throw run time exception like RI. This fixes
two cases found with fuzz testing. CL also includes
fail-before/pass-after test.

Test: 600-verifier-fails

BUG=29758098

Change-Id: Ie80f7758def44e6655d28fec4c10c34ffa0fd60b
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index f2ae85a..7373819 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -1257,6 +1257,10 @@
   if (descriptor[0] != 'L') {
     Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "can't call new-instance on type '" << descriptor << "'";
     return false;
+  } else if (strcmp(descriptor, "Ljava/lang/Class;") == 0) {
+    // An unlikely new instance on Class is not allowed. Fall back to interpreter to ensure an
+    // exception is thrown when this statement is executed (compiled code would not do that).
+    Fail(VERIFY_ERROR_INSTANTIATION);
   }
   return true;
 }