Commit 510f4a9b authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: [regexp] correctly advance zero length matches for global/unicode.

Port  57d202d8

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}
parent 73aea9c1
......@@ -851,8 +851,11 @@ Handle<HeapObject> RegExpMacroAssemblerPPC::GetCode(Handle<String> 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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment