Closed Bug 627609 Opened 9 years ago Closed 9 years ago

Empty group matching fails on /((a|)+b)+/.exec('bb')

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: cdleary, Assigned: dmandelin)

References

Details

(Keywords: regression, Whiteboard: softblocker, fixed-in-tracemonkey)

Attachments

(1 file)

dmandelin and I thought through this example in talking over the patch for bug 599854. We need a more robust way of tracking parens with valid empty group matches.
blocking2.0: --- → ?
Blocks: 576822
blocking2.0: ? → betaN+
Whiteboard: softblocker
Attached patch PatchSplinter Review
Assignee: general → dmandelin
Status: NEW → ASSIGNED
Attachment #506578 - Flags: review?(cdleary)
Comment on attachment 506578 [details] [diff] [review]
Patch

This is clearly the right way to do it: if I knew what I was doing a little more when we first imported PCRE or we had a test case like this one, maybe I would have found this solution. :-)

Quantified assertions are invalid in the ES5 spec, although the ES3 grammar seems to allow it, which would calls into question examples like |/(?=foo)+/.exec('foofoo')|.

Can atOptionalBracket fall off the beginning of the pattern? If not, we should put a comment as to why the negative indexing is safe.

IRL we talked about whether BRAMINZERO was needed as a case within atOptionalBracket, but it doesn't seem so: if you lazy match my matching the empty string this situation should be equivalent to not executing the regexp within the lazy match at all. A comment about this within the atOptionalBracket would be nice.
Attachment #506578 - Flags: review?(cdleary) → review+
http://hg.mozilla.org/tracemonkey/rev/9f58085a9081
Whiteboard: softblocker → softblocker, fixed-in-tracemonkey
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Depends on: 635417
No longer blocks: 576822
Duplicate of this bug: 576822
You need to log in before you can comment on or make changes to this bug.