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

Changeset 276524 in webkit


Ignore:
Timestamp:
Apr 23, 2021, 3:14:11 PM (5 years ago)
Author:
mark.lam@apple.com
Message:

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:
Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r276516 r276524  
     12021-04-23  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix B3 strength reduction for shl.
     4        https://bugs.webkit.org/show_bug.cgi?id=224913
     5        rdar://76978874
     6
     7        Reviewed by Michael Saboff.
     8
     9        If the operation can potentially either underflow or overflow, then the result
     10        can be any value.
     11
     12        * b3/B3ReduceStrength.cpp:
     13
    1142021-04-23  Fujii Hironori  <Hironori.Fujii@sony.com>
    215
  • trunk/Source/JavaScriptCore/b3/B3ReduceStrength.cpp

    r275800 r276524  
    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.