Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 146607def5edb2814ca921b4149269b49bf7f89f..d4d18c41679fc1d1b670b9298a01df2219b9c1ce 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -3128,6 +3128,7 @@ MUST_USE_RESULT static MaybeObject* StringReplaceRegExpWithString( |
if (global_cache.HasException()) return Failure::Exception(); |
if (prev < subject_length) { |
+ builder.EnsureCapacity(2); |
builder.AddSubjectSlice(prev, subject_length); |
} |