diff options
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r-- | runtime/class_linker.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index a2f451347a..b829f5916c 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -2180,9 +2180,11 @@ bool ClassLinker::AddImageSpace( ObjPtr<mirror::Class> klass(root.Read()); // Do not update class loader for boot image classes where the app image // class loader is only the initiating loader but not the defining loader. - // Avoid read barrier since we are comparing against null. - if (klass->GetClassLoader<kDefaultVerifyFlags, kWithoutReadBarrier>() != nullptr) { + if (space->HasAddress(klass.Ptr())) { klass->SetClassLoader(loader); + } else { + DCHECK(klass->IsBootStrapClassLoaded()); + DCHECK(Runtime::Current()->GetHeap()->ObjectIsInBootImageSpace(klass.Ptr())); } } } |