[Webkit-unassigned] [Bug 48102] New: YARR incorrectly matches later in string with alternate and sticky flag

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 21 16:46:39 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=48102

           Summary: YARR incorrectly matches later in string with
                    alternate and sticky flag
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
               URL: https://bugzilla.mozilla.org/show_bug.cgi?id=576823
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: oliver at apple.com


[reply] [-] Description Jesse Ruderman 2010-07-03 21:30:57 PDT
/A|B/y.exec("CB")

YARR: ["B"]
Old: null

I think YARR is correct and the old engine is incorrect.  But I'd like a fix
for the old engine so we can do more thorough compare-fuzzing to find bugs in
YARR.
[reply] [-] Comment 1 Chris Leary [:cdleary] 2010-07-04 00:05:52 PDT
Since lastIndex is 0, the old engine is correct. I'll take a look.
[reply] [-] Comment 2 Jesse Ruderman 2010-07-04 00:33:15 PDT
Ahh, I missed the part where /y means not only "start at lastIndex" but also
"don't match forward".  (As if there were a ^ at the beginning of the regexp
and you had sliced the string.)
[reply] [-] Comment 3 Chris Leary [:cdleary] 2010-08-27 15:31:59 PDT
Created attachment 470057 [details]
Fix sticky patterns with disjunctions.

Whoops, rookie mistake -- the caret was getting stuck to the LHS of the
disjunction. Need to wrap the rest of the expression in (?:) to keep things
balanced across disjunctions. This fixes it:

$ ./js -e 'print(/A|B/y.exec("CB"))'
null
[reply] [-] Comment 4

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list