<?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>232058</bug_id>
          
          <creation_ts>2021-10-20 17:23:37 -0700</creation_ts>
          <short_desc>Add missing overflow check to DFGIntegerRangeOptimizationPhase::filterConstant()</short_desc>
          <delta_ts>2021-10-21 16:02:58 -0700</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>rmorisset</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>1806945</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2021-10-20 17:23:37 -0700</bug_when>
    <thetext>From code review, it appears that an overflow check is needed when creating a more specific Relationship.

Consider the current code:
   ...
        if (sumOverflows&lt;int&gt;(otherRight, other.m_offset))
            return *this;

        int otherEffectiveRight = otherRight + other.m_offset;

        switch (other.m_kind) {
        case Equal:
            // Return a version of *this that is Equal to other&apos;s constant.
            return Relationship(m_left, m_right, Equal, otherEffectiveRight - thisRight);
    ...

We check if other&apos;s value + offset overflows, but what about the case where otherEffectiveRight - thisRight might overflow?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806947</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2021-10-20 17:24:01 -0700</bug_when>
    <thetext>&lt;rdar://84375007&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806952</commentid>
    <comment_count>2</comment_count>
      <attachid>441964</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2021-10-20 17:27:11 -0700</bug_when>
    <thetext>Created attachment 441964
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806957</commentid>
    <comment_count>3</comment_count>
      <attachid>441964</attachid>
    <who name="Robin Morisset">rmorisset</who>
    <bug_when>2021-10-20 17:37:20 -0700</bug_when>
    <thetext>Comment on attachment 441964
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1807247</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2021-10-21 10:54:55 -0700</bug_when>
    <thetext>Committed r284623 (243344@main): &lt;https://commits.webkit.org/243344@main&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 441964.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>441964</attachid>
            <date>2021-10-20 17:27:11 -0700</date>
            <delta_ts>2021-10-21 10:54:56 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>232058.patch</filename>
            <type>text/plain</type>
            <size>1324</size>
            <attacher name="Michael Saboff">msaboff</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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ludGVnZXJSYW5nZU9wdGltaXphdGlvblBoYXNlLmNwcAkod29ya2luZyBjb3B5KQpAQCAtNTY4
LDYgKzU2OCw5IEBAIHB1YmxpYzoKIAogICAgICAgICBzd2l0Y2ggKG90aGVyLm1fa2luZCkgewog
ICAgICAgICBjYXNlIEVxdWFsOgorICAgICAgICAgICAgaWYgKGRpZmZlcmVuY2VPdmVyZmxvd3M8
aW50PihvdGhlckVmZmVjdGl2ZVJpZ2h0LCB0aGlzUmlnaHQpKQorICAgICAgICAgICAgICAgIHJl
dHVybiAqdGhpczsKKwogICAgICAgICAgICAgLy8gUmV0dXJuIGEgdmVyc2lvbiBvZiAqdGhpcyB0
aGF0IGlzIEVxdWFsIHRvIG90aGVyJ3MgY29uc3RhbnQuCiAgICAgICAgICAgICByZXR1cm4gUmVs
YXRpb25zaGlwKG1fbGVmdCwgbV9yaWdodCwgRXF1YWwsIG90aGVyRWZmZWN0aXZlUmlnaHQgLSB0
aGlzUmlnaHQpOwogCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>