Partially ObjPtr<>-ify Object, fix stale ref in test.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 31113334
Change-Id: I0c0bc669c0ab8d99185e662a2fec16f32a42a0a2
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 6e12eba..db79128 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -2985,7 +2985,7 @@
if (UNLIKELY(old != result_ptr)) {
// Return `old` (even if `!descriptor_equals`) to mimic the RI behavior for parallel
// capable class loaders. (All class loaders are considered parallel capable on Android.)
- mirror::Class* loader_class = class_loader->GetClass();
+ ObjPtr<mirror::Class> loader_class = class_loader->GetClass();
const char* loader_class_name =
loader_class->GetDexFile().StringByTypeIdx(loader_class->GetDexTypeIndex());
LOG(WARNING) << "Initiating class loader of type " << DescriptorToDot(loader_class_name)