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

Unified Diff: src/heap/slot-set.h

Issue 2256113002: Workaround for gcc array bound check issue (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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: src/heap/slot-set.h
diff --git a/src/heap/slot-set.h b/src/heap/slot-set.h
index 0066bf57b6cf2e8196d5bec24c3ba593a1823d71..5817f26626646a0a96c510921ee677f5f94b38c5 100644
--- a/src/heap/slot-set.h
+++ b/src/heap/slot-set.h
@@ -72,7 +72,8 @@ class SlotSet : public Malloced {
SlotToIndices(end_offset, &end_bucket, &end_cell, &end_bit);
uint32_t start_mask = (1u << start_bit) - 1;
uint32_t end_mask = ~((1u << end_bit) - 1);
- if (start_bucket == end_bucket && start_cell == end_cell) {
+ if (start_bucket == end_bucket && start_cell == end_cell &&
+ start_bucket < kBuckets) {
MaskCell(start_bucket, start_cell, start_mask | end_mask);
Michael Lippautz 2016/08/18 09:19:19 I would guess that the access in MaskCell is the p
return;
}
@@ -100,7 +101,8 @@ class SlotSet : public Malloced {
}
// All buckets between start_bucket and end_bucket are cleared.
DCHECK(current_bucket == end_bucket && current_cell <= end_cell);
- if (current_bucket == kBuckets || bucket[current_bucket] == nullptr) {
+ if (current_bucket == kBuckets || (current_bucket < kBuckets &&
Michael Lippautz 2016/08/18 09:19:19 If you do above, then just add a comment that refe
+ bucket[current_bucket] == nullptr)) {
return;
}
while (current_cell < end_cell) {
@@ -109,7 +111,9 @@ class SlotSet : public Malloced {
}
// All cells between start_cell and end_cell are cleared.
DCHECK(current_bucket == end_bucket && current_cell == end_cell);
- MaskCell(end_bucket, end_cell, end_mask);
+ if (end_bucket < kBuckets) {
+ MaskCell(end_bucket, end_cell, end_mask);
+ }
}
// The slot offset specifies a slot at address page_start_ + slot_offset.
« 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