Fix two read barrier bugs introduced in CL 97882.
Bug: 12687968
Change-Id: Ib28da4c33977cc58b09913ef5b738dec75365714
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 1436810..ea02ab1 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -2563,8 +2563,9 @@
for (auto it = class_table_.lower_bound(hash), end = class_table_.end(); it != end && it->first == hash;
++it) {
- mirror::Class* entry = it->second;
- if (entry == existing) {
+ mirror::Class** root = &it->second;
+ mirror::Class* klass = ReadBarrier::BarrierForRoot<mirror::Class, kWithReadBarrier>(root);
+ if (klass == existing) {
class_table_.erase(it);
break;
}