Changeset 202597 in webkit
- Timestamp:
- Jun 28, 2016 5:38:58 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202596 r202597 1 2016-06-28 Michael Saboff <msaboff@apple.com> 2 3 REGRESSION (r200946): Improper backtracking from last alternative in sticky patterns 4 https://bugs.webkit.org/show_bug.cgi?id=159233 5 6 Reviewed by Mark Lam. 7 8 Updated tests. 9 10 * js/regexp-sticky-expected.txt: 11 * js/script-tests/regexp-sticky.js: 12 1 13 2016-06-28 Ryan Haddad <ryanhaddad@apple.com> 2 14 -
trunk/LayoutTests/js/regexp-sticky-expected.txt
r200946 r202597 27 27 PASS Global Flag - exec 28 28 PASS Global Flag - match 29 PASS Global Flag - Alternates, long to short 29 30 PASS Unicode Flag - Any Character 30 31 PASS Unicode & Ignore Case Flags 31 32 PASS Multiline 32 33 PASS Multiline with BOL Anchor 34 PASS Multiline with EOL Anchor at start of Alternative 33 35 PASS "123 1234 ".search(re) is 0 34 36 PASS "123 1234 ".search(re) is 0 -
trunk/LayoutTests/js/script-tests/regexp-sticky.js
r200946 r202597 93 93 testStickyExec("Global Flag - exec", /\s*(\+|[0-9]+)\s*/gy, "3 + 4", 0, ["3 ,3", "+ ,+", "4,4", null]); 94 94 testStickyMatch("Global Flag - match", /\s*(\+|[0-9]+)\s*/gy, "3 + 4", 0, [["3 ", "+ ", "4"], ["3 ", "+ ", "4"]]); 95 testStickyMatch("Global Flag - Alternates, long to short", /x.|[\d]/gy, ".a", 0, [null]); 95 96 testStickyExec("Unicode Flag - Any Character", /./uy, "a@\u{10402}1\u202a\u{12345}", 0, ["a", "@", "\u{10402}", "1", "\u202a", "\u{12345}", null]); 96 97 testStickyMatch("Unicode & Ignore Case Flags", /(?:\u{118c0}|\u{10cb0}|\w):/iuy, "a:\u{118a0}:x:\u{10cb0}", 0, [["a:"], ["\u{118a0}:"], ["x:"], null]); 97 98 testStickyExec("Multiline", /(?:\w+ *)+(?:\n|$)/my, "Line One\nLine Two", 0, ["Line One\n", "Line Two", null]); 98 99 testStickyMatch("Multiline with BOL Anchor", /^\d*\s?/my, "13574\n295\n99", 0, [["13574\n"], ["295\n"], ["99"], null]); 100 testStickyExec("Multiline with EOL Anchor at start of Alternative", /.{2}|(?=$)./my, "\n", 0, [null]); 99 101 100 102 // Verify that String.search starts at 0 even with the sticky flag. -
trunk/Source/JavaScriptCore/ChangeLog
r202588 r202597 1 2016-06-28 Michael Saboff <msaboff@apple.com> 2 3 REGRESSION (r200946): Improper backtracking from last alternative in sticky patterns 4 https://bugs.webkit.org/show_bug.cgi?id=159233 5 6 Reviewed by Mark Lam. 7 8 Jump to fail exit code when the last alternative of a sticky pattern fails. 9 10 * yarr/YarrJIT.cpp: 11 (JSC::Yarr::YarrGenerator::backtrack): 12 1 13 2016-06-28 Saam Barati <sbarati@apple.com> 2 14 -
trunk/Source/JavaScriptCore/yarr/YarrJIT.cpp
r200946 r202597 1829 1829 1830 1830 bool onceThrough = endOp.m_nextOp == notFound; 1831 1832 JumpList lastStickyAlternativeFailures; 1831 1833 1832 1834 // First, generate code to handle cases where we backtrack out of an attempted match … … 1844 1846 && (alternative->m_minimumSize - beginOp->m_alternative->m_minimumSize == 1)) 1845 1847 m_backtrackingState.linkTo(beginOp->m_reentry, this); 1846 else { 1848 else if (m_pattern.sticky() && m_ops[op.m_nextOp].m_op == OpBodyAlternativeEnd) { 1849 // It is a sticky pattern and the last alternative failed, jump to the end. 1850 m_backtrackingState.takeBacktracksToJumpList(lastStickyAlternativeFailures, this); 1851 } else { 1847 1852 // We need to generate a trampoline of code to execute before looping back 1848 1853 // around to the first alternative. 1849 1854 m_backtrackingState.link(this); 1850 1855 1851 // No need to advance and retry for a stick pattern.1856 // No need to advance and retry for a sticky pattern. 1852 1857 if (!m_pattern.sticky()) { 1853 1858 // If the pattern size is not fixed, then store the start index for use if we match. … … 1999 2004 matchFailed.link(this); 2000 2005 } 2006 2007 lastStickyAlternativeFailures.link(this); 2001 2008 removeCallFrame(); 2002 2009 generateFailReturn();
Note: See TracChangeset
for help on using the changeset viewer.