Check existing_it in UpdateClass
Check that the iterator is valid instead of blindly dereferencing it.
Bug: 160074700
Test: manual
Change-Id: I444b3335f52251a24f47261b42296667bd668444
diff --git a/runtime/class_table.cc b/runtime/class_table.cc
index c854dc5..cb87ee2 100644
--- a/runtime/class_table.cc
+++ b/runtime/class_table.cc
@@ -56,7 +56,7 @@
// Should only be updating latest table.
DescriptorHashPair pair(descriptor, hash);
auto existing_it = classes_.back().FindWithHash(pair, hash);
- if (kIsDebugBuild && existing_it == classes_.back().end()) {
+ if (existing_it == classes_.back().end()) {
for (const ClassSet& class_set : classes_) {
if (class_set.FindWithHash(pair, hash) != class_set.end()) {
LOG(FATAL) << "Updating class found in frozen table " << descriptor;