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

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: moved array bound check to MaskCell 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..651af88bf8ffc5e4118f1c352faaf2152d5637ed 100644
--- a/src/heap/slot-set.h
+++ b/src/heap/slot-set.h
@@ -194,9 +194,15 @@ class SlotSet : public Malloced {
}
void MaskCell(int bucket_index, int cell_index, uint32_t mask) {
- uint32_t* cells = bucket[bucket_index];
- if (cells != nullptr && cells[cell_index] != 0) {
- cells[cell_index] &= mask;
+ if (bucket_index < kBuckets) {
+ uint32_t* cells = bucket[bucket_index];
+ if (cells != nullptr && cells[cell_index] != 0) {
+ cells[cell_index] &= mask;
+ }
+ } else {
+ // GCC bug 59124: Emits wrong warnings
+ // "array subscript is above array bounds"
+ UNREACHABLE();
}
}
« 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