<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>267011</bug_id>
          
          <creation_ts>2024-01-02 16:19:44 -0800</creation_ts>
          <short_desc>[JSC] RegExp /u flag doesn&apos;t respect atomicity of surrogate pairs</short_desc>
          <delta_ts>2024-11-29 17:09:02 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=283840</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>267593</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexey Shvayka">ashvayka</reporter>
          <assigned_to name="Michael Saboff">msaboff</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>schuyler</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2002645</commentid>
    <comment_count>0</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2024-01-02 16:19:44 -0800</bug_when>
    <thetext>Simple test case: /\uDC9A$/u.exec(&quot;a💚&quot;) // \uDC9A being a trailing surrogate of 💚
Expected: null
Actual: matches \uDC9A

The bug is observed in both JIT and Interpreter, anywhere we match characters (another good example is negated character classes).
Current logic allows us to end up in-between trailing and leading surrogate, producing false matches.

Related test262 failures:
  * test/built-ins/RegExp/prototype/Symbol.search/u-lastindex-advance.js
  * test/built-ins/RegExp/prototype/Symbol.split/u-lastindex-adv-thru-failure.js
  * test/built-ins/RegExp/prototype/exec/u-lastindex-adv.js
  * test/language/literals/regexp/u-astral-char-class-invert.js</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2002646</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-01-02 16:20:01 -0800</bug_when>
    <thetext>&lt;rdar://problem/120391451&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2004264</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2024-01-10 16:48:24 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/22631</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2004509</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-01-11 11:17:40 -0800</bug_when>
    <thetext>Committed 272928@main (584a9a820ab2): &lt;https://commits.webkit.org/272928@main&gt;

Reviewed commits have been landed. Closing PR #22631 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2004687</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2024-01-12 07:58:25 -0800</bug_when>
    <thetext>*** Bug 205477 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2005296</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2024-01-16 10:36:44 -0800</bug_when>
    <thetext>The fix in 272928@main regressed performance in JetStream2 / UniPoker.  Rolling this out to address the performance regression.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2005323</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2024-01-16 11:16:04 -0800</bug_when>
    <thetext>Fix with performance regression reverted in 273081@main (9d426c6ff391): &lt;https://commits.webkit.org/273081@main&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2019368</commentid>
    <comment_count>7</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2024-03-07 10:04:29 -0800</bug_when>
    <thetext>This is now being tracked as:
&lt;rdar://124217243&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2020556</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2024-03-12 13:47:13 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/25793</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2020741</commentid>
    <comment_count>9</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-03-13 09:47:04 -0700</bug_when>
    <thetext>Committed 276031@main (67969c218ddf): &lt;https://commits.webkit.org/276031@main&gt;

Reviewed commits have been landed. Closing PR #25793 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>