summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2017-04-03 16:55:16 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2017-04-03 21:34:46 +0100
commit8e33e84072c6d22788e61a0b1a7db56f0ca14c26 (patch)
treed9308c99a0a9baaa90ff44ef28aee48d6518058b
parentfcab6513b5e635f3fbf4f875b9530086371f5dac (diff)
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
-rw-r--r--compiler/optimizing/inliner.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 79cd7048a5..298ae5c847 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -371,6 +371,12 @@ ArtMethod* HInliner::TryCHADevirtualization(ArtMethod* resolved_method) {
// 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;
}