Changeset 205362 in webkit


Ignore:
Timestamp:
Sep 2, 2016 12:39:02 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

bitwise_cast infinite loops if called from the default constructor in ToType
https://bugs.webkit.org/show_bug.cgi?id=161365

Patch by JF Bastien <jfbastien@apple.com> on 2016-09-02
Reviewed by Saam Barati.

  • wtf/StdLibExtras.h:

(WTF::bitwise_cast): use aggregate initialization to avoid ctor

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r205325 r205362  
     12016-09-02  JF Bastien  <jfbastien@apple.com>
     2
     3        bitwise_cast infinite loops if called from the default constructor in ToType
     4        https://bugs.webkit.org/show_bug.cgi?id=161365
     5
     6        Reviewed by Saam Barati.
     7
     8        * wtf/StdLibExtras.h:
     9        (WTF::bitwise_cast): use aggregate initialization to avoid ctor
     10
    1112016-09-01  Anders Carlsson  <andersca@apple.com>
    212
  • trunk/Source/WTF/wtf/StdLibExtras.h

    r205066 r205362  
    152152    static_assert(__is_trivially_copyable(FromType), "bitwise_cast of non-trivially-copyable type!");
    153153#endif
    154     ToType to;
     154    ToType to{ };
    155155    std::memcpy(&to, &from, sizeof(to));
    156156    return to;
Note: See TracChangeset for help on using the changeset viewer.