From ab5327d3d57d0d3561e697f196da7f2ee2e50290 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 18 Mar 2016 11:36:20 +0000 Subject: Check if the type of an instruction is erroneous before inlining. We can get HInstructions typed with a class that is in an error state. For such classes, we cannot look at the vtable or imt table as they are not cleanly populated. bug:27683927 Change-Id: I0d64ca470e1cb6cf9b40e9f02bb9b0bb12c2bac1 --- compiler/optimizing/inliner.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/optimizing/inliner.cc') diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 573b58340c..440a2821c1 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -144,6 +144,10 @@ static ArtMethod* FindVirtualOrInterfaceTarget(HInvoke* invoke, ArtMethod* resol } else if (!resolved_method->GetDeclaringClass()->IsAssignableFrom(info.GetTypeHandle().Get())) { // The method that we're trying to call is not in the receiver's class or super classes. return nullptr; + } else if (info.GetTypeHandle()->IsErroneous()) { + // If the type is erroneous, do not go further, as we are going to query the vtable or + // imt table, that we can only safely do on non-erroneous classes. + return nullptr; } ClassLinker* cl = Runtime::Current()->GetClassLinker(); -- cgit v1.2.3-59-g8ed1b