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

Unified Diff: src/runtime.cc

Issue 115507: Add 2 asserts in search-replace implementation. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 1985)
+++ src/runtime.cc (working copy)
@@ -1420,6 +1420,7 @@
void AddElement(Object* element) {
ASSERT(element->IsSmi() || element->IsString());
+ ASSERT(parts_->length() > part_count_);
parts_->set(part_count_, element);
part_count_++;
}
@@ -1589,6 +1590,7 @@
if (i > last) {
parts->Add(ReplacementPart::ReplacementSubString(last, i));
}
+ ASSERT(capture_ref <= capture_count);
parts->Add(ReplacementPart::SubjectCapture(capture_ref));
last = next_index + 1;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698