⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 276525 in webkit


Ignore:
Timestamp:
Apr 23, 2021, 3:46:21 PM (5 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r276524. rdar://problem/77089783

Fix B3 strength reduction for shl.
https://bugs.webkit.org/show_bug.cgi?id=224913
rdar://76978874

Reviewed by Michael Saboff.

If the operation can potentially either underflow or overflow, then the result
can be any value.

  • b3/B3ReduceStrength.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276524 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-611-branch/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-611-branch/Source/JavaScriptCore/ChangeLog

    r276517 r276525  
     12021-04-23  Ruben Turcios  <rubent_22@apple.com>
     2
     3        Cherry-pick r276524. rdar://problem/77089783
     4
     5    Fix B3 strength reduction for shl.
     6    https://bugs.webkit.org/show_bug.cgi?id=224913
     7    rdar://76978874
     8   
     9    Reviewed by Michael Saboff.
     10   
     11    If the operation can potentially either underflow or overflow, then the result
     12    can be any value.
     13   
     14    * b3/B3ReduceStrength.cpp:
     15   
     16   
     17   
     18    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     19
     20    2021-04-23  Mark Lam  <mark.lam@apple.com>
     21
     22            Fix B3 strength reduction for shl.
     23            https://bugs.webkit.org/show_bug.cgi?id=224913
     24            rdar://76978874
     25
     26            Reviewed by Michael Saboff.
     27
     28            If the operation can potentially either underflow or overflow, then the result
     29            can be any value.
     30
     31            * b3/B3ReduceStrength.cpp:
     32
    1332021-04-23  Russell Epstein  <repstein@apple.com>
    234
  • branches/safari-611-branch/Source/JavaScriptCore/b3/B3ReduceStrength.cpp

    r267783 r276525  
    241241        T newMax = static_cast<T>(m_max) << static_cast<T>(shiftAmount);
    242242
    243         if ((newMin >> shiftAmount) != static_cast<T>(m_min))
     243        if (((newMin >> shiftAmount) != static_cast<T>(m_min))
     244            || ((newMax >> shiftAmount) != static_cast<T>(m_max))) {
    244245            newMin = std::numeric_limits<T>::min();
    245         if ((newMax >> shiftAmount) != static_cast<T>(m_max))
    246246            newMax = std::numeric_limits<T>::max();
     247        }
    247248
    248249        return IntRange(newMin, newMax);
Note: See TracChangeset for help on using the changeset viewer.