From dae24142127c64551142a50423085aabdb0a6060 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Thu, 3 Dec 2015 17:27:32 -0800 Subject: ART: Check invoke-interface earlier in verifier Invoke-interface should only be called on an interface method. Move the check earlier, as otherwise we'll try to resolve and potentially inject a method into the dex cache. Also templatize ResolveMethod with a version always checking the invoke type, and on a cache miss check whether type target type is an interface when an interface invoke type was given. Bug: 21869691 Change-Id: Ica27158f675b5aa223d9229248189612f4706832 --- compiler/driver/compiler_driver.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/driver/compiler_driver.cc') diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 9d3af1681a..a05105b84e 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -1902,7 +1902,7 @@ class ResolveClassFieldsAndMethodsVisitor : public CompilationVisitor { } if (resolve_fields_and_methods) { while (it.HasNextDirectMethod()) { - ArtMethod* method = class_linker->ResolveMethod( + ArtMethod* method = class_linker->ResolveMethod( dex_file, it.GetMemberIndex(), dex_cache, class_loader, nullptr, it.GetMethodInvokeType(class_def)); if (method == nullptr) { @@ -1911,7 +1911,7 @@ class ResolveClassFieldsAndMethodsVisitor : public CompilationVisitor { it.Next(); } while (it.HasNextVirtualMethod()) { - ArtMethod* method = class_linker->ResolveMethod( + ArtMethod* method = class_linker->ResolveMethod( dex_file, it.GetMemberIndex(), dex_cache, class_loader, nullptr, it.GetMethodInvokeType(class_def)); if (method == nullptr) { -- cgit v1.2.3-59-g8ed1b