Bug 177570

Summary: REGRESSION(210837): RegExp containing failed non-zero minimum greedy groups incorrectly match
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, danlec, fpizlo, keith_miller, mark.lam, mathias, sbarati, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Michael Saboff 2017-09-27 14:50:38 PDT
The expression /(Q)+|Z*Z/.test("Z ") should return false but returns true.
Comment 1 Michael Saboff 2017-09-27 14:53:26 PDT
Fix in progress.
Comment 2 Radar WebKit Bug Importer 2017-09-27 14:53:29 PDT
<rdar://problem/34698189>
Comment 3 Daniel LeCheminant 2017-09-27 15:28:01 PDT
/(Q)+|Z*Z/.test("Z ") 

*should* actually return true but e.g.

/(Q)+|(Z)+Z/.test("Z ") 

should return false
Comment 4 Michael Saboff 2017-09-27 19:16:09 PDT
(In reply to Daniel LeCheminant from comment #3)
> /(Q)+|Z*Z/.test("Z ") 
> 
> *should* actually return true but e.g.
> 
> /(Q)+|(Z)+Z/.test("Z ") 
> 
> should return false

You are right, sorry for the confusion.  The RegExp in the description is wrong.
Comment 5 Michael Saboff 2017-09-27 19:16:22 PDT
Created attachment 322056 [details]
Patch
Comment 6 Michael Saboff 2017-09-27 20:33:25 PDT
The test failures are due to changes r222586 and are being addressed in https://bugs.webkit.org/show_bug.cgi?id=177423.
Comment 7 Mark Lam 2017-09-27 21:03:44 PDT
Comment on attachment 322056 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=322056&action=review

> Source/JavaScriptCore/ChangeLog:10
> +        greedy parenthesis have backtracked as far as possible.  Prior to r210837 when non-zero minimum greedy
> +        parenthesis were factored into a fixed component and then a zero-based variable component.  After

Is there a typo in the sentence "Prior to r210837..."?  I don't understand what it's trying to say.
Comment 8 WebKit Commit Bot 2017-09-27 22:15:53 PDT
Comment on attachment 322056 [details]
Patch

Clearing flags on attachment: 322056

Committed r222601: <http://trac.webkit.org/changeset/222601>
Comment 9 WebKit Commit Bot 2017-09-27 22:15:55 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Michael Saboff 2017-09-28 04:21:35 PDT
(In reply to Mark Lam from comment #7)
> Comment on attachment 322056 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=322056&action=review
> 
> > Source/JavaScriptCore/ChangeLog:10
> > +        greedy parenthesis have backtracked as far as possible.  Prior to r210837 when non-zero minimum greedy
> > +        parenthesis were factored into a fixed component and then a zero-based variable component.  After
> 
> Is there a typo in the sentence "Prior to r210837..."?  I don't understand
> what it's trying to say.

I checked in a fix to that sentence.