ART: Add guards to the dex cache and its shortcuts

Do not return fields, methods or classes if the (declaring) class is
erroneous.

Bug: 16692788
Change-Id: If43c2414ad0eb22db5eba7cf66396c7f16c26597
diff --git a/runtime/method_helper-inl.h b/runtime/method_helper-inl.h
index 4f95a28..3a5056a 100644
--- a/runtime/method_helper-inl.h
+++ b/runtime/method_helper-inl.h
@@ -28,7 +28,7 @@
 
 inline mirror::Class* MethodHelper::GetClassFromTypeIdx(uint16_t type_idx, bool resolve) {
   mirror::ArtMethod* method = GetMethod();
-  mirror::Class* type = method->GetDexCacheResolvedTypes()->Get(type_idx);
+  mirror::Class* type = method->GetDexCacheResolvedType(type_idx);
   if (type == nullptr && resolve) {
     type = Runtime::Current()->GetClassLinker()->ResolveType(type_idx, method);
     CHECK(type != nullptr || Thread::Current()->IsExceptionPending());