Commit 757ea240 authored by bjaideep's avatar bjaideep Committed by Commit bot

Workaround for gcc array bound check issue

V8 doesn't build on Ubuntu 16.04 (with GCC 5.3). Seems to be
a known regression on newer GCC version. It emits incorrect
"error: array subscript is above array bounds" message. Adding
explicit array bound check fixes the issue.

R=hablich@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2256113002
Cr-Commit-Position: refs/heads/master@{#38721}
parent 280fdf64
......@@ -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();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment