Commit 48da24bb authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

Change how start and end addresses of young strings are retrieved

This CL changes how the start and end address for the iteration are
retrieved from an std::vector that won't cause a failed assertion.

There are some std::vector implementations that contain bounds checks.
The string table iteration code uses an access like
{&young_strings_[young_strings_.size()]} to retrieve the end address
for an iteration. This results in a out of bounds exception on such a
std::vector implementation even though the "element" itself is not actually
accessed.

Change-Id: I31db8994a7ff613897ad9deac953a1ee91f322b3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1704097Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62742}
parent fac5898d
......@@ -2576,8 +2576,8 @@ void Heap::ExternalStringTable::IterateYoung(RootVisitor* v) {
if (!young_strings_.empty()) {
v->VisitRootPointers(
Root::kExternalStringsTable, nullptr,
FullObjectSlot(&young_strings_[0]),
FullObjectSlot(&young_strings_[young_strings_.size()]));
FullObjectSlot(young_strings_.data()),
FullObjectSlot(young_strings_.data() + young_strings_.size()));
}
}
......
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