Set dex_cache_strings_ when we call Class::SetDexCache
Ensures that these two variables never get out of sync. The error
was presumably related to not doing this for proxy classes. This
caused java code which was looking at the dex_cache_strings_ field
to incorrectly access a null array.
Bug: 18548887
(cherry picked from commit ea1c3d77b92b30ec527f2ca5bfe316a882b698e0)
Change-Id: I022d9311b38b61e160ed70e3c5d9639797adb29c
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index f092772..4bd702d 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -2780,7 +2780,7 @@
klass->SetDexClassDefIndex(dex_file.GetIndexForClassDef(dex_class_def));
klass->SetDexTypeIndex(dex_class_def.class_idx_);
- klass->SetDexCacheStrings(klass->GetDexCache()->GetStrings());
+ CHECK(klass->GetDexCacheStrings() != nullptr);
const uint8_t* class_data = dex_file.GetClassData(dex_class_def);
if (class_data == nullptr) {