CHA: Don't return a non resolved class to the inliner.
This fixes a race with class loading that updates CHA info
before setting a class to resolved.
bug:36848868
Test: relocate-npatchoat
Change-Id: I662d63e60de4921a942c5a1fecfbff34b57928e4
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 79cd704..298ae5c 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -371,6 +371,12 @@
// invoke-virtual because a proxy method doesn't have a real dex file.
return nullptr;
}
+ if (!single_impl->GetDeclaringClass()->IsResolved()) {
+ // There's a race with the class loading, which updates the CHA info
+ // before setting the class to resolved. So we just bail for this
+ // rare occurence.
+ return nullptr;
+ }
return single_impl;
}