diff options
author | 2020-10-12 15:43:23 -0700 | |
---|---|---|
committer | 2020-10-13 14:36:22 +0000 | |
commit | 1a8d83b69dd6097e0d467a9ed0afb09c4025738d (patch) | |
tree | ca925fd30efd35f42d33c65c01ec4c0b31698e4c /runtime/class_table.cc | |
parent | 5c5ed3025f1a7cda51abe87319c42f5b002bf189 (diff) |
Check existing_it in UpdateClass
Check that the iterator is valid instead of blindly dereferencing it.
Bug: 160074700
Test: manual
Change-Id: I444b3335f52251a24f47261b42296667bd668444
Diffstat (limited to 'runtime/class_table.cc')
-rw-r--r-- | runtime/class_table.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/class_table.cc b/runtime/class_table.cc index c854dc5fe1..cb87ee2f8a 100644 --- a/runtime/class_table.cc +++ b/runtime/class_table.cc @@ -56,7 +56,7 @@ ObjPtr<mirror::Class> ClassTable::UpdateClass(const char* descriptor, // 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; |