Fix issue with exception type resolution during linking.

When using default methods that cross dex-files we would sometimes
attempt to lookup method information using the wrong dex file. This
fixes this issue.

Bug: 26872564

Change-Id: I3c4b64ef970017356962060f3bd3781b4629a3c8
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index e98baba..5ef199c 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -3666,7 +3666,7 @@
     }
     self->AssertNoPendingException();
     // Make sure all classes referenced by catch blocks are resolved.
-    ResolveClassExceptionHandlerTypes(dex_file, klass);
+    ResolveClassExceptionHandlerTypes(klass);
     if (verifier_failure == verifier::MethodVerifier::kNoFailure) {
       // Even though there were no verifier failures we need to respect whether the super-class and
       // super-default-interfaces were verified or requiring runtime reverification.
@@ -3802,17 +3802,16 @@
   UNREACHABLE();
 }
 
-void ClassLinker::ResolveClassExceptionHandlerTypes(const DexFile& dex_file,
-                                                    Handle<mirror::Class> klass) {
+void ClassLinker::ResolveClassExceptionHandlerTypes(Handle<mirror::Class> klass) {
   for (ArtMethod& method : klass->GetMethods(image_pointer_size_)) {
-    ResolveMethodExceptionHandlerTypes(dex_file, &method);
+    ResolveMethodExceptionHandlerTypes(&method);
   }
 }
 
-void ClassLinker::ResolveMethodExceptionHandlerTypes(const DexFile& dex_file,
-                                                     ArtMethod* method) {
+void ClassLinker::ResolveMethodExceptionHandlerTypes(ArtMethod* method) {
   // similar to DexVerifier::ScanTryCatchBlocks and dex2oat's ResolveExceptionsForMethod.
-  const DexFile::CodeItem* code_item = dex_file.GetCodeItem(method->GetCodeItemOffset());
+  const DexFile::CodeItem* code_item =
+      method->GetDexFile()->GetCodeItem(method->GetCodeItemOffset());
   if (code_item == nullptr) {
     return;  // native or abstract method
   }