Closed
Bug 1350579
Opened 8 years ago
Closed 8 months ago
JS_ExecuteRegExpNoStatics() is heavily broken
Categories
(Core :: JavaScript Engine, defect, P3)
Core
JavaScript Engine
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: ehsan.akhgari, Unassigned)
References
Details
(Keywords: triage-deferred)
Attachments
(1 file)
While working on bug 1347425, I tried to use JS_ExecuteRegExpNoStatics() in a similar manner to how it's used in nsContentUtils::IsPatternMatching() <http://searchfox.org/mozilla-central/rev/7419b368156a6efa24777b21b0e5706be89a9c2f/dom/base/nsContentUtils.cpp#6814>, and it seemed to work, and the test we had in the tree with the regular expression to match passed: <http://searchfox.org/mozilla-central/rev/7419b368156a6efa24777b21b0e5706be89a9c2f/netwerk/test/mochitests/test_user_agent_overrides.html#26>.
And then I tried adding a similar test with a different regex! This time, "0". That didn't work. I narrowed it down to ExecuteRegExpImpl <http://searchfox.org/mozilla-central/rev/7419b368156a6efa24777b21b0e5706be89a9c2f/js/src/builtin/RegExp.cpp#153> returning RegExpRunStatus_Success_NotFound. The string in which I was searching was "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0".
I then tried "zilla". That one worked. "illa" didn't. "[0-9]+" din't either... This code is being used for several use cases but in every case for full string matches (i.e., "^(...)$"), so I hope whatever the underlying cause ends up being doesn't affect that, but at this is at least worth investigation given the fact that we're shipping code relying on this function. :(
Reporter | ||
Comment 1•8 years ago
|
||
After applying this patch, you can build with it, then edit this test and change the regex on line 26 of netwerk/test/mochitests/test_user_agent_overrides.html to "illa".
Comment 4•8 years ago
|
||
(In reply to :Ehsan Akhgari (super long backlog, slow to respond) from comment #3)
> Yes, by all means! :-)
Thanks
Can you assign me this bug then?
Flags: needinfo?(ehsan)
Reporter | ||
Comment 5•8 years ago
|
||
Here you go! I'll also grant you editbugs access so that you can you can do this yourself the next time you were interested to fix a bug. :-)
(BTW sorry for the long delay to get back to you.)
Assignee: nobody → avikalpakundu
Reporter | ||
Updated•8 years ago
|
Flags: needinfo?(ehsan)
Updated•8 years ago
|
Status: NEW → ASSIGNED
Updated•7 years ago
|
Keywords: triage-deferred
Priority: -- → P3
Comment 6•3 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Assignee: avikalpakundu → nobody
Status: ASSIGNED → NEW
Updated•2 years ago
|
Severity: normal → S3
Updated•8 months ago
|
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•