summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2016-03-18 11:36:20 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2016-03-21 11:23:28 +0000
commitab5327d3d57d0d3561e697f196da7f2ee2e50290 (patch)
treeab08ed0f15b8166140baeabd7d4c96239b6a9037 /compiler/optimizing
parente4914ec0d83544243257e55d0f0b9da3ed7f147a (diff)
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
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/inliner.cc4
1 files changed, 4 insertions, 0 deletions
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();