Modified: trunk/Source/WTF/ChangeLog (203305 => 203306)
--- trunk/Source/WTF/ChangeLog 2016-07-15 22:27:53 UTC (rev 203305)
+++ trunk/Source/WTF/ChangeLog 2016-07-15 22:38:30 UTC (rev 203306)
@@ -1,5 +1,17 @@
2016-07-15 Chris Dumez <[email protected]>
+ Unreviewed, rolling out r203304.
+
+ This is wrong because of Node* entries in the internal HashMap
+
+ Reverted changeset:
+
+ "Add move constructor / assignment operator to ListHashSet"
+ https://bugs.webkit.org/show_bug.cgi?id=159837
+ http://trac.webkit.org/changeset/203304
+
+2016-07-15 Chris Dumez <[email protected]>
+
Add move constructor / assignment operator to ListHashSet
https://bugs.webkit.org/show_bug.cgi?id=159837
Modified: trunk/Source/WTF/wtf/ListHashSet.h (203305 => 203306)
--- trunk/Source/WTF/wtf/ListHashSet.h 2016-07-15 22:27:53 UTC (rev 203305)
+++ trunk/Source/WTF/wtf/ListHashSet.h 2016-07-15 22:38:30 UTC (rev 203306)
@@ -19,7 +19,8 @@
*
*/
-#pragma once
+#ifndef WTF_ListHashSet_h
+#define WTF_ListHashSet_h
#include <wtf/HashSet.h>
@@ -68,11 +69,9 @@
typedef HashTableAddResult<iterator> AddResult;
- ListHashSet() = default;
+ ListHashSet();
ListHashSet(const ListHashSet&);
- ListHashSet(ListHashSet&&) = default;
ListHashSet& operator=(const ListHashSet&);
- ListHashSet& operator=(ListHashSet&&) = default;
~ListHashSet();
void swap(ListHashSet&);
@@ -150,8 +149,8 @@
const_iterator makeConstIterator(Node*) const;
HashTable<Node*, Node*, IdentityExtractor, NodeHash, NodeTraits, NodeTraits> m_impl;
- Node* m_head { nullptr };
- Node* m_tail { nullptr };
+ Node* m_head;
+ Node* m_tail;
};
template<typename ValueArg> struct ListHashSetNode {
@@ -160,12 +159,14 @@
template<typename T>
ListHashSetNode(T&& value)
: m_value(std::forward<T>(value))
+ , m_prev(0)
+ , m_next(0)
{
}
ValueArg m_value;
- ListHashSetNode* m_prev { nullptr };
- ListHashSetNode* m_next { nullptr };
+ ListHashSetNode* m_prev;
+ ListHashSetNode* m_next;
};
template<typename HashArg> struct ListHashSetNodeHashFunctions {
@@ -259,7 +260,7 @@
const_iterator& operator++()
{
- ASSERT(m_position);
+ ASSERT(m_position != 0);
m_position = m_position->m_next;
return *this;
}
@@ -306,7 +307,16 @@
};
template<typename T, typename U>
+inline ListHashSet<T, U>::ListHashSet()
+ : m_head(0)
+ , m_tail(0)
+{
+}
+
+template<typename T, typename U>
inline ListHashSet<T, U>::ListHashSet(const ListHashSet& other)
+ : m_head(0)
+ , m_tail(0)
{
for (auto it = other.begin(), end = other.end(); it != end; ++it)
add(*it);
@@ -592,8 +602,8 @@
{
deleteAllNodes();
m_impl.clear();
- m_head = nullptr;
- m_tail = nullptr;
+ m_head = 0;
+ m_tail = 0;
}
template<typename T, typename U>
@@ -627,7 +637,7 @@
void ListHashSet<T, U>::appendNode(Node* node)
{
node->m_prev = m_tail;
- node->m_next = nullptr;
+ node->m_next = 0;
if (m_tail) {
ASSERT(m_head);
@@ -643,7 +653,7 @@
template<typename T, typename U>
void ListHashSet<T, U>::prependNode(Node* node)
{
- node->m_prev = nullptr;
+ node->m_prev = 0;
node->m_next = m_head;
if (m_head)
@@ -676,7 +686,7 @@
if (!m_head)
return;
- for (Node* node = m_head, *next = m_head->m_next; node; node = next, next = node ? node->m_next : nullptr)
+ for (Node* node = m_head, *next = m_head->m_next; node; node = next, next = node ? node->m_next : 0)
delete node;
}
@@ -695,3 +705,5 @@
} // namespace WTF
using WTF::ListHashSet;
+
+#endif /* WTF_ListHashSet_h */