Changeset 177753 in webkit


Ignore:
Timestamp:
Dec 26, 2014, 5:17:01 PM (10 years ago)
Author:
mitz@apple.com
Message:

Build fix.

Removed use of builtin_s{add,sub}_overflow introduced in r177729 that was causing a compiler used at Apple to crash because of <rdar://problem/19347133>.

  • wtf/SaturatedArithmetic.h:

(signedAddOverflows):
(signedSubtractOverflows):

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r177746 r177753  
     12014-12-26  Dan Bernstein  <mitz@apple.com>
     2
     3        Build fix.
     4
     5        Removed use of __builtin_s{add,sub}_overflow introduced in r177729 that was causing a compiler used at Apple to crash because of <rdar://problem/19347133>.
     6
     7        * wtf/SaturatedArithmetic.h:
     8        (signedAddOverflows):
     9        (signedSubtractOverflows):
     10
    1112014-12-26  Dan Bernstein  <mitz@apple.com>
    212
  • trunk/Source/WTF/wtf/SaturatedArithmetic.h

    r177736 r177753  
    4040inline bool signedAddOverflows(int32_t a, int32_t b, int32_t& result)
    4141{
    42 #if COMPILER_HAS_CLANG_BUILTIN(__builtin_sadd_overflow)
    43     return __builtin_sadd_overflow(a, b, &result);
    44 #else
    4542    uint32_t ua = a;
    4643    uint32_t ub = b;
     
    5148    // bit of the result and one of the values differ it did overflow.
    5249    return !((ua ^ ub) >> 31) & (uresult ^ ua) >> 31;
    53 #endif
    5450}
    5551
     
    7268inline bool signedSubtractOverflows(int32_t a, int32_t b, int32_t& result)
    7369{
    74 #if COMPILER_HAS_CLANG_BUILTIN(__builtin_ssub_overflow)
    75     return __builtin_ssub_overflow(a, b, &result);
    76 #else
    7770    uint32_t ua = a;
    7871    uint32_t ub = b;
     
    8376    // signed bit of the result and the first value differ it did overflow.
    8477    return (ua ^ ub) >> 31 & (uresult ^ ua) >> 31;
    85 #endif
    8678}
    8779
Note: See TracChangeset for help on using the changeset viewer.