summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2018-12-20 14:07:32 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-12-20 14:07:32 +0000
commitadf595900e6f6328c68a15b88f53529cb5e520f3 (patch)
tree59c080ac1b5c0a190ce3da72e619b622b54790f4 /compiler/driver/compiler_driver.cc
parent43faa46d2362c451d5a4599cd5c7b7ee13f3d221 (diff)
parentc4a924d8c74241057d957d360bf31cd5cd0e4f9c (diff)
Merge changes I5e42f85c,I60174623
* changes: Keep dex location from OatDexFile. Remove unresolved classes from image classes.
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 0039be0fde..f52c566727 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -1231,8 +1231,15 @@ class ClinitImageUpdate {
bool operator()(ObjPtr<mirror::Class> klass) override REQUIRES_SHARED(Locks::mutator_lock_) {
std::string temp;
StringPiece name(klass->GetDescriptor(&temp));
- if (data_->image_class_descriptors_->find(name) != data_->image_class_descriptors_->end()) {
- data_->image_classes_.push_back(hs_.NewHandle(klass));
+ auto it = data_->image_class_descriptors_->find(name);
+ if (it != data_->image_class_descriptors_->end()) {
+ if (LIKELY(klass->IsResolved())) {
+ data_->image_classes_.push_back(hs_.NewHandle(klass));
+ } else {
+ DCHECK(klass->IsErroneousUnresolved());
+ VLOG(compiler) << "Removing unresolved class from image classes: " << name;
+ data_->image_class_descriptors_->erase(it);
+ }
} else {
// Check whether it is initialized and has a clinit. They must be kept, too.
if (klass->IsInitialized() && klass->FindClassInitializer(