Changeset 207237 in webkit


Ignore:
Timestamp:
Oct 12, 2016 1:38:37 PM (8 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r207225.

This change causes debug tests to exit early with crashes.

Reverted changeset:

"Optional's move-constructor and move-assignment operator
don't disengage the value being moved from"
https://bugs.webkit.org/show_bug.cgi?id=163309
http://trac.webkit.org/changeset/207225

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r207225 r207237  
     12016-10-12  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r207225.
     4
     5        This change causes debug tests to exit early with crashes.
     6
     7        Reverted changeset:
     8
     9        "Optional's move-constructor and move-assignment operator
     10        don't disengage the value being moved from"
     11        https://bugs.webkit.org/show_bug.cgi?id=163309
     12        http://trac.webkit.org/changeset/207225
     13
    1142016-10-11  Sam Weinig  <sam@webkit.org>
    215
  • trunk/Source/WTF/wtf/Optional.h

    r207225 r207237  
    7272        : m_isEngaged(other.m_isEngaged)
    7373    {
    74         if (m_isEngaged) {
     74        if (m_isEngaged)
    7575            new (NotNull, &m_value) T(WTFMove(*other.asPtr()));
    76             other.m_isEngaged = false;
    77         }
    7876    }
    7977
     
    124122            new (NotNull, &m_value) T(WTFMove(*other.asPtr()));
    125123            m_isEngaged = true;
    126             other.m_isEngaged = false;
    127124        }
    128125        return *this;
  • trunk/Tools/ChangeLog

    r207236 r207237  
     12016-10-12  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r207225.
     4
     5        This change causes debug tests to exit early with crashes.
     6
     7        Reverted changeset:
     8
     9        "Optional's move-constructor and move-assignment operator
     10        don't disengage the value being moved from"
     11        https://bugs.webkit.org/show_bug.cgi?id=163309
     12        http://trac.webkit.org/changeset/207225
     13
    1142016-10-12  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/Tools/TestWebKitAPI/Tests/WTF/Optional.cpp

    r207225 r207237  
    2626#include "config.h"
    2727
    28 #include "Counters.h"
    2928#include <wtf/Optional.h>
    3029
     
    148147}
    149148
    150 TEST(WTF_Optional, MoveConstructor)
    151 {
    152     {
    153         CopyMoveCounter::TestingScope scope;
    154 
    155         Optional<CopyMoveCounter> optional(InPlace);
    156 
    157         EXPECT_EQ(1U, CopyMoveCounter::constructionCount);
    158         EXPECT_EQ(0U, CopyMoveCounter::copyCount);
    159         EXPECT_EQ(0U, CopyMoveCounter::moveCount);
    160 
    161         EXPECT_TRUE(static_cast<bool>(optional));
    162    
    163         Optional<CopyMoveCounter> movedTo(WTFMove(optional));
    164 
    165         EXPECT_EQ(1U, CopyMoveCounter::constructionCount);
    166         EXPECT_EQ(0U, CopyMoveCounter::copyCount);
    167         EXPECT_EQ(1U, CopyMoveCounter::moveCount);
    168 
    169         EXPECT_FALSE(static_cast<bool>(optional));
    170         EXPECT_TRUE(static_cast<bool>(movedTo));
    171     }
    172 }
    173 
    174 TEST(WTF_Optional, MoveAssignment)
    175 {
    176     {
    177         CopyMoveCounter::TestingScope scope;
    178 
    179         Optional<CopyMoveCounter> optional(InPlace);
    180 
    181         EXPECT_EQ(1U, CopyMoveCounter::constructionCount);
    182         EXPECT_EQ(0U, CopyMoveCounter::copyCount);
    183         EXPECT_EQ(0U, CopyMoveCounter::moveCount);
    184 
    185         EXPECT_TRUE(static_cast<bool>(optional));
    186    
    187         Optional<CopyMoveCounter> movedTo = WTFMove(optional);
    188 
    189         EXPECT_EQ(1U, CopyMoveCounter::constructionCount);
    190         EXPECT_EQ(0U, CopyMoveCounter::copyCount);
    191         EXPECT_EQ(1U, CopyMoveCounter::moveCount);
    192 
    193         EXPECT_FALSE(static_cast<bool>(optional));
    194         EXPECT_TRUE(static_cast<bool>(movedTo));
    195     }
    196 }
    197149
    198150} // namespace TestWebKitAPI
Note: See TracChangeset for help on using the changeset viewer.