<?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>232024</bug_id>
          
          <creation_ts>2021-10-20 11:11:03 -0700</creation_ts>
          <short_desc>Add missing overflow checks to DFGIntegerRangeOptimizationPhase::isEquivalentTo()</short_desc>
          <delta_ts>2022-02-27 23:24:58 -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>
          
          
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Saboff">msaboff</reporter>
          <assigned_to name="Michael Saboff">msaboff</assigned_to>
          <cc>ews-watchlist</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>saam</cc>
    
    <cc>tzagallo</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1806707</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2021-10-20 11:11:03 -0700</bug_when>
    <thetext>In isEquivalentTo() we should check for overflow when adding offsets.

    bool isEquivalentTo(const Relationship&amp; other) const
    {
        ...

        if (m_right-&gt;isInt32Constant() &amp;&amp; other.m_right-&gt;isInt32Constant()) {
            return (thisRight + m_offset) == (otherRight + other.m_offset);
        }
        ...
    }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806713</commentid>
    <comment_count>1</comment_count>
      <attachid>441903</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2021-10-20 11:20:12 -0700</bug_when>
    <thetext>Created attachment 441903
Patch with mini-mode fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806716</commentid>
    <comment_count>2</comment_count>
      <attachid>441903</attachid>
    <who name="Tadeu Zagallo">tzagallo</who>
    <bug_when>2021-10-20 11:21:37 -0700</bug_when>
    <thetext>Comment on attachment 441903
Patch with mini-mode fix.

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806718</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2021-10-20 11:23:31 -0700</bug_when>
    <thetext>&lt;rdar://84329018&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806719</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2021-10-20 11:24:28 -0700</bug_when>
    <thetext>Ignore the &quot;mini-mode&quot; comment - It was auto filled from Safari.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806727</commentid>
    <comment_count>5</comment_count>
      <attachid>441903</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2021-10-20 11:30:04 -0700</bug_when>
    <thetext>Comment on attachment 441903
Patch with mini-mode fix.

View in context: https://bugs.webkit.org/attachment.cgi?id=441903&amp;action=review

&gt; Source/JavaScriptCore/ChangeLog:8
&gt; +        Added overflow chaeck before comparing for equality.

typo: chaeck</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806729</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2021-10-20 11:30:47 -0700</bug_when>
    <thetext>(In reply to Mark Lam from comment #5)
&gt; Comment on attachment 441903 [details]
&gt; Patch with mini-mode fix.
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=441903&amp;action=review
&gt; 
&gt; &gt; Source/JavaScriptCore/ChangeLog:8
&gt; &gt; +        Added overflow chaeck before comparing for equality.
&gt; 
&gt; typo: chaeck

Will fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806859</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2021-10-20 14:45:18 -0700</bug_when>
    <thetext>Committed r284573 (243313@main): &lt;https://commits.webkit.org/243313@main&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>441903</attachid>
            <date>2021-10-20 11:20:12 -0700</date>
            <delta_ts>2022-02-27 23:24:58 -0800</delta_ts>
            <desc>Patch with mini-mode fix.</desc>
            <filename>232024.patch</filename>
            <type>text/plain</type>
            <size>1738</size>
            <attacher name="Michael Saboff">msaboff</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMjg0NTUwKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE0IEBA
CisyMDIxLTEwLTIwICBNaWNoYWVsIFNhYm9mZiAgPG1zYWJvZmZAYXBwbGUuY29tPgorCisgICAg
ICAgIEFkZCBtaXNzaW5nIG92ZXJmbG93IGNoZWNrcyB0byBERkdJbnRlZ2VyUmFuZ2VPcHRpbWl6
YXRpb25QaGFzZTo6aXNFcXVpdmFsZW50VG8oKQorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0
Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MjMyMDI0CisKKyAgICAgIC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pc0ludDMyQ29uc3RhbnQoKSAmJiBvdGhlci5tX3JpZ2h0LT5pc0ludDMyQ29u
c3RhbnQoKSkgeworICAgICAgICAgICAgaW50IHRoaXNSaWdodCA9IG1fcmlnaHQtPmFzSW50MzIo
KTsKKyAgICAgICAgICAgIGludCBvdGhlclJpZ2h0ID0gb3RoZXIubV9yaWdodC0+YXNJbnQzMigp
OworCisgICAgICAgICAgICBpZiAoc3VtT3ZlcmZsb3dzPGludD4odGhpc1JpZ2h0LCBtX29mZnNl
dCkpCisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgaWYgKHN1bU92
ZXJmbG93czxpbnQ+KG90aGVyUmlnaHQsIG90aGVyLm1fb2Zmc2V0KSkKKyAgICAgICAgICAgICAg
ICByZXR1cm4gZmFsc2U7CisKKyAgICAgICAgICAgIHJldHVybiAodGhpc1JpZ2h0ICsgbV9vZmZz
ZXQpID09IChvdGhlclJpZ2h0ICsgb3RoZXIubV9vZmZzZXQpOworICAgICAgICB9CiAgICAgICAg
IHJldHVybiBmYWxzZTsKICAgICB9CiAgICAgCg==
</data>
<flag name="review"
          id="466294"
          type_id="1"
          status="+"
          setter="tzagallo"
    />
          </attachment>
      

    </bug>

</bugzilla>