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

Unified Diff: src/runtime.cc

Issue 402056: Fix crash in string replace with regexp. If the suffix of the subject... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 1 month 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-515.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 3331)
+++ src/runtime.cc (working copy)
@@ -1750,10 +1750,10 @@
// Index of end of last match.
int prev = 0;
- // Number of parts added by compiled replacement plus preceeding string
- // and possibly suffix after last match. It is possible for compiled
- // replacements to use two elements when encoded as two smis.
- const int parts_added_per_loop = compiled_replacement.parts() * 2 + 2;
+ // Number of parts added by compiled replacement plus preceeding
+ // string and possibly suffix after last match. It is possible for
+ // all components to use two elements when encoded as two smis.
+ const int parts_added_per_loop = 2 * (compiled_replacement.parts() + 2);
bool matched = true;
do {
ASSERT(last_match_info_handle->HasFastElements());
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-515.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698