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

Unified Diff: src/jsregexp.cc

Issue 10824278: Fix wrong indexing in global regexp. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: adding one more repro 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-crbug-142087.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jsregexp.cc
diff --git a/src/jsregexp.cc b/src/jsregexp.cc
index 74ec739d9c136d47420827bd7859a3c69521bb5b..0bca6a997d4ce7e9f55a3787c0dd4e262f1a29af 100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -753,7 +753,7 @@ RegExpImpl::GlobalCache::GlobalCache(Handle<JSRegExp> regexp,
ASSERT(registers_per_match_ >= 2); // Each match has at least one capture.
ASSERT_GE(register_array_size_, registers_per_match_);
int32_t* last_match =
- &register_array_[register_array_size_ - registers_per_match_];
+ &register_array_[(current_match_index_ - 1) * registers_per_match_];
last_match[0] = -1;
last_match[1] = 0;
}
@@ -779,7 +779,7 @@ int32_t* RegExpImpl::GlobalCache::FetchNext() {
}
int32_t* last_match =
- &register_array_[register_array_size_ - registers_per_match_];
+ &register_array_[(current_match_index_ - 1) * registers_per_match_];
int last_end_index = last_match[1];
if (regexp_->TypeTag() == JSRegExp::ATOM) {
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-142087.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698