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

Unified Diff: src/runtime.cc

Issue 10830304: Ensure capacity when adding parts in String.replace. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | test/mjsunit/regress/regress-2289.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-2289.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698