WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
ASSIGNED
200786
Add ability for the YARR JIT to properly handle nested expressions that can match without consuming characters
https://bugs.webkit.org/show_bug.cgi?id=200786
Summary
Add ability for the YARR JIT to properly handle nested expressions that can m...
Michael Saboff
Reported
2019-08-15 13:37:43 PDT
The YARR interpreter has a function for matching nested expressions that might not consume characters. This is needed when we try to match containing parenthesis which have variable counts, but their contents match an empty string. An example regex is /(a*)*x/. When we use this regex to match "aa", we'll match the "aa" via the parenthesis sub pattern and then fail trying to match the 'x'. Then we'll backtrack. The (a*)* subexpression will match a zero length string and try match the 'x'. We have now entered an infinite loop that only exits due to exceeding the loop try count. In the case where the parenthesis has a variable count, the interpreter will make sure that each time we try matching the parenthesis contents, we make sure we actually consumes characters. This is done in the interpreter with the function matchNonZeroDisjunction(). The JIT should emit the same kind of logic.
Attachments
Add attachment
proposed patch, testcase, etc.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug