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

Unified Diff: src/regexp/x64/regexp-macro-assembler-x64.cc

Issue 1630633002: [regexp] correctly advance zero length matches for global/unicode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@backrefbounds
Patch Set: Created 4 years, 11 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
Index: src/regexp/x64/regexp-macro-assembler-x64.cc
diff --git a/src/regexp/x64/regexp-macro-assembler-x64.cc b/src/regexp/x64/regexp-macro-assembler-x64.cc
index 286f159cc8e5ac4d04416e6a2f32c7aec735aa06..c861d7a4896f5b406f983a93580ac8b860d8f1df 100644
--- a/src/regexp/x64/regexp-macro-assembler-x64.cc
+++ b/src/regexp/x64/regexp-macro-assembler-x64.cc
@@ -869,11 +869,14 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
__ testp(rdi, rdi);
__ j(zero, &exit_label_, Label::kNear);
// Advance current position after a zero-length match.
+ Label advance;
+ __ bind(&advance);
if (mode_ == UC16) {
__ addq(rdi, Immediate(2));
} else {
__ incq(rdi);
}
+ if (global_unicode()) CheckNotInSurrogatePair(0, &advance);
}
__ jmp(&load_char_start_regexp);

Powered by Google App Engine
This is Rietveld 408576698