Commit 1609f3b9 authored by jameslahm's avatar jameslahm Committed by V8 LUCI CQ

[runtime] Add TODO to check expected_parts

... not exceeding the maximum size of the backing store
before ReplacementStringBuilder in StringReplaceGlobalRegExpWithString.

Bug: v8:12843
Change-Id: I3ccf07a4e6de35a3a571ebfccc34e54eb27a0819
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3616555Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarJakob Linke <jgruber@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#80298}
parent ac7d42c4
......@@ -664,6 +664,8 @@ V8_WARN_UNUSED_RESULT static Object StringReplaceGlobalRegExpWithString(
// from. Global regexps can match any number of times, so we guess
// conservatively.
int expected_parts = (compiled_replacement.parts() + 1) * 4 + 1;
// TODO(v8:12843): improve the situation where the expected_parts exceeds
// the maximum size of the backing store.
ReplacementStringBuilder builder(isolate->heap(), subject, expected_parts);
int prev = 0;
......
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