Bug 223498 - [YARR] Interpreter incorrectly matches non-BMP characters with multiple .
Summary: [YARR] Interpreter incorrectly matches non-BMP characters with multiple .
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-18 21:03 PDT by Michael Saboff
Modified: 2021-03-22 15:08 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.32 KB, patch)
2021-03-19 09:36 PDT, Michael Saboff
mark.lam: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Updated patch to fix layout test (7.09 KB, patch)
2021-03-19 12:59 PDT, Michael Saboff
ysuzuki: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2021-03-18 21:03:09 PDT
Consider the expression:
  let m = String.fromCodePoint(0x10000).match(/../u);
It should not match.  The . atom (any character, but newline) should match the non-BMP character U+10000 leaving the second . nothing to match causing the whole RegExp to fail.

The Yarr JIT properly processes the RegExp, but the Yarr interpreter erroneously matches.
Comment 1 Michael Saboff 2021-03-18 21:03:45 PDT
<rdar://74698760>
Comment 2 Michael Saboff 2021-03-19 09:36:39 PDT
Created attachment 423737 [details]
Patch
Comment 3 Michael Saboff 2021-03-19 12:59:52 PDT
Created attachment 423764 [details]
Updated patch to fix layout test
Comment 4 Yusuke Suzuki 2021-03-19 13:59:06 PDT
Comment on attachment 423764 [details]
Updated patch to fix layout test

r=me
Comment 5 Michael Saboff 2021-03-22 15:08:45 PDT
Committed r274806 (235606@main): <https://commits.webkit.org/235606@main>