summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/class_linker.cc4
-rw-r--r--runtime/mirror/dex_cache-inl.h8
2 files changed, 6 insertions, 6 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index c0e5704342..9ac27a126e 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -1666,6 +1666,10 @@ bool ClassLinker::AddImageSpace(
// resolve the same way, simply flatten the hierarchy in the way the resolution order would be,
// and check that the dex file names are the same.
for (mirror::ClassLoader* image_class_loader : image_class_loaders) {
+ if (IsBootClassLoader(soa, image_class_loader)) {
+ // The dex cache can reference types from the boot class loader.
+ continue;
+ }
std::list<mirror::String*> image_dex_file_names;
std::string temp_error_msg;
if (!FlattenPathClassLoader(image_class_loader, &image_dex_file_names, &temp_error_msg)) {
diff --git a/runtime/mirror/dex_cache-inl.h b/runtime/mirror/dex_cache-inl.h
index 2da3d8479c..2894b68f03 100644
--- a/runtime/mirror/dex_cache-inl.h
+++ b/runtime/mirror/dex_cache-inl.h
@@ -148,9 +148,7 @@ inline void DexCache::FixupStrings(GcRoot<mirror::String>* dest, const Visitor&
for (size_t i = 0, count = NumStrings(); i < count; ++i) {
mirror::String* source = src[i].Read<kReadBarrierOption>();
mirror::String* new_source = visitor(source);
- if (source != new_source) {
- dest[i] = GcRoot<mirror::String>(new_source);
- }
+ dest[i] = GcRoot<mirror::String>(new_source);
}
}
@@ -160,9 +158,7 @@ inline void DexCache::FixupResolvedTypes(GcRoot<mirror::Class>* dest, const Visi
for (size_t i = 0, count = NumResolvedTypes(); i < count; ++i) {
mirror::Class* source = src[i].Read<kReadBarrierOption>();
mirror::Class* new_source = visitor(source);
- if (source != new_source) {
- dest[i] = GcRoot<mirror::Class>(new_source);
- }
+ dest[i] = GcRoot<mirror::Class>(new_source);
}
}