Index: src/regexp/jsregexp-inl.h |
diff --git a/src/regexp/jsregexp-inl.h b/src/regexp/jsregexp-inl.h |
index 3eb7c3c1704b998b6bebe5b06bbbed65d156ffc3..ca7a9fe9918630719570c68a86ac4ec9629c794c 100644 |
--- a/src/regexp/jsregexp-inl.h |
+++ b/src/regexp/jsregexp-inl.h |
@@ -47,7 +47,10 @@ int32_t* RegExpImpl::GlobalCache::FetchNext() { |
register_array_size_); |
} else { |
int last_start_index = last_match[0]; |
- if (last_start_index == last_end_index) last_end_index++; |
+ if (last_start_index == last_end_index) { |
+ // Zero-length match. Advance by one code point. |
+ last_end_index = AdvanceZeroLength(last_end_index); |
+ } |
if (last_end_index > subject_->length()) { |
num_matches_ = 0; // Signal failed match. |
return NULL; |