From 510f4a9b8f836de4e49f08bd044a8f49b8038f51 Mon Sep 17 00:00:00 2001 From: mbrandy Date: Wed, 27 Jan 2016 13:07:03 -0800 Subject: [PATCH] PPC: [regexp] correctly advance zero length matches for global/unicode. Port 57d202d879dbf7589a7d2c1466b2698d3a2d9c21 R=yangguo@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com BUG=v8:2952 LOG=N Review URL: https://codereview.chromium.org/1646613002 Cr-Commit-Position: refs/heads/master@{#33566} --- src/regexp/ppc/regexp-macro-assembler-ppc.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/regexp/ppc/regexp-macro-assembler-ppc.cc b/src/regexp/ppc/regexp-macro-assembler-ppc.cc index a630952b61..c05c580e86 100644 --- a/src/regexp/ppc/regexp-macro-assembler-ppc.cc +++ b/src/regexp/ppc/regexp-macro-assembler-ppc.cc @@ -851,8 +851,11 @@ Handle RegExpMacroAssemblerPPC::GetCode(Handle source) { __ cmpi(current_input_offset(), Operand::Zero()); __ beq(&exit_label_); // Advance current position after a zero-length match. + Label advance; + __ bind(&advance); __ addi(current_input_offset(), current_input_offset(), Operand((mode_ == UC16) ? 2 : 1)); + if (global_unicode()) CheckNotInSurrogatePair(0, &advance); } __ b(&load_char_start_regexp);