Commit e3ae7ad9 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[regexp] fix regexp lookbehind with back reference on ARM.

BUG=chromium:695416

Change-Id: Ied3a389d0dfb0132c798bc85e10f7b1fd4432eb4
Reviewed-on: https://chromium-review.googlesource.com/446343Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43435}
parent e2d8ef47
......@@ -368,7 +368,7 @@ void RegExpMacroAssemblerARM::CheckNotBackReference(int start_reg,
__ ldr(r3, MemOperand(frame_pointer(), kStringStartMinusOne));
__ add(r3, r3, r1);
__ cmp(current_input_offset(), r3);
BranchOrBacktrack(lt, on_no_match);
BranchOrBacktrack(le, on_no_match);
} else {
__ cmn(r1, Operand(current_input_offset()));
BranchOrBacktrack(gt, on_no_match);
......
......@@ -387,7 +387,7 @@ void RegExpMacroAssemblerPPC::CheckNotBackReference(int start_reg,
__ LoadP(r6, MemOperand(frame_pointer(), kStringStartMinusOne));
__ add(r6, r6, r4);
__ cmp(current_input_offset(), r6);
BranchOrBacktrack(lt, on_no_match);
BranchOrBacktrack(le, on_no_match);
} else {
__ add(r0, r4, current_input_offset(), LeaveOE, SetRC);
BranchOrBacktrack(gt, on_no_match, cr0);
......
......@@ -376,7 +376,7 @@ void RegExpMacroAssemblerS390::CheckNotBackReference(int start_reg,
__ LoadP(r5, MemOperand(frame_pointer(), kStringStartMinusOne));
__ AddP(r5, r5, r3);
__ CmpP(current_input_offset(), r5);
BranchOrBacktrack(lt, on_no_match);
BranchOrBacktrack(le, on_no_match);
} else {
__ AddP(r0, r3, current_input_offset());
BranchOrBacktrack(gt, on_no_match, cr0);
......
......@@ -157,6 +157,7 @@ assertEquals(["abc", "abc"], /(abc\1)/i.exec("abc\u1234"));
var oob_subject = "abcdefghijklmnabcdefghijklmn".substr(14);
assertNull(oob_subject.match(/(?=(abcdefghijklmn))(?<=\1)a/i));
assertNull(oob_subject.match(/(?=(abcdefghijklmn))(?<=\1)a/));
assertNull("abcdefgabcdefg".substr(1).match(/(?=(abcdefg))(?<=\1)/));
// Mutual recursive capture/back references
assertEquals(["cacb", "a", ""], /(?<=a(.\2)b(\1)).{4}/.exec("aabcacbc"));
......
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