Merge "Fix FindDeclaredVirtualMethod(DexCache...) for miranda methods"
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index 8eafd6f..884aac1 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -489,7 +489,9 @@
   if (GetDexCache() == dex_cache) {
     for (size_t i = 0; i < NumVirtualMethods(); ++i) {
       ArtMethod* method = GetVirtualMethod(i);
-      if (method->GetDexMethodIndex() == dex_method_idx) {
+      if (method->GetDexMethodIndex() == dex_method_idx &&
+          // A miranda method may have a different DexCache.
+          method->GetDexCache() == dex_cache) {
         return method;
       }
     }