Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: runtime/vm/hash_map.h

Issue 2729813004: Fixes issue #28904 and issue #28901. Fixed an out of range array access in the hash map Iterator::N… (Closed)
Patch Set: Added parens around boolean expression Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/hash_map.h
diff --git a/runtime/vm/hash_map.h b/runtime/vm/hash_map.h
index c9eb941c9a13bcb1bcc26326c57bb6ea4fc7907f..ff473013f4d643cd115d200dcf0a25fb716b1ce1 100644
--- a/runtime/vm/hash_map.h
+++ b/runtime/vm/hash_map.h
@@ -175,8 +175,8 @@ BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::Iterator::Next() {
if (array_index_ < map_.array_size_) {
// If we're not in the middle of a list, find the next array slot.
if (list_index_ == kNil) {
- while (KeyValueTrait::ValueOf(map_.array_[array_index_].kv) == kNoValue &&
- array_index_ < map_.array_size_) {
+ while ((array_index_ < map_.array_size_) &&
+ KeyValueTrait::ValueOf(map_.array_[array_index_].kv) == kNoValue) {
array_index_++;
}
if (array_index_ < map_.array_size_) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698