WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
278624
Fix WTF::HashSet<Class> and WTF::HashSet<RetainPtr<>> to work with ARC and upstream clang
https://bugs.webkit.org/show_bug.cgi?id=278624
Summary
Fix WTF::HashSet<Class> and WTF::HashSet<RetainPtr<>> to work with ARC and up...
David Kilzer (:ddkilzer)
Reported
2024-08-25 08:29:48 PDT
Fix WTF::HashSet<Class> and WTF::HashSet<RetainPtr<>> to work with ARC and upstream clang. Example compiler errors: In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:597:54: error: cast of an indirect pointer to an Objective-C pointer to 'unsigned int *' is disallowed with ARC 597 | unsigned keyCount() const { return m_table ? reinterpret_cast_ptr<unsigned*>(m_table)[keyCountOffset] : 0; } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:31: In file included from Source/WebKit/config.h:42: In file included from WebKitBuild/Release/usr/local/include/wtf/FastMalloc.h:26: WebKitBuild/Release/usr/local/include/wtf/StdLibExtras.h:126:30: note: expanded from macro 'reinterpret_cast_ptr' 126 | #define reinterpret_cast_ptr reinterpret_cast | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:460:40: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::keyCount' requested here 460 | unsigned size() const { return keyCount(); } | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1333:40: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::size' requested here 1333 | unsigned otherKeyCount = other.size(); | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1364:19: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::HashTable' requested here 1364 | HashTable tmp(other); | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: WebKitBuild/Release/usr/local/include/wtf/HashSet.h:31:7: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::operator=' requested here 31 | class HashSet final { | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1158:20: error: cast of a non-Objective-C pointer type 'char *' to 'ValueType *' (aka '__strong Class *') is disallowed with ARC 1158 | return reinterpret_cast_ptr<ValueType*>(static_cast<char*>(HashTableMalloc::zeroedMalloc(metadataSize + size * sizeof(ValueType))) + metadataSize); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:31: In file included from Source/WebKit/config.h:42: In file included from WebKitBuild/Release/usr/local/include/wtf/FastMalloc.h:26: WebKitBuild/Release/usr/local/include/wtf/StdLibExtras.h:126:30: note: expanded from macro 'reinterpret_cast_ptr' 126 | #define reinterpret_cast_ptr reinterpret_cast | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1338:19: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::allocateTable' requested here 1338 | m_table = allocateTable(bestTableSize); | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1364:19: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::HashTable' requested here 1364 | HashTable tmp(other); | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: WebKitBuild/Release/usr/local/include/wtf/HashSet.h:31:7: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::operator=' requested here 31 | class HashSet final { | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1160:29: error: cast of a non-Objective-C pointer type 'char *' to 'ValueType *' (aka '__strong Class *') is disallowed with ARC 1160 | ValueType* result = reinterpret_cast_ptr<ValueType*>(static_cast<char*>(HashTableMalloc::malloc(metadataSize + size * sizeof(ValueType))) + metadataSize); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:31: In file included from Source/WebKit/config.h:42: In file included from WebKitBuild/Release/usr/local/include/wtf/FastMalloc.h:26: WebKitBuild/Release/usr/local/include/wtf/StdLibExtras.h:126:30: note: expanded from macro 'reinterpret_cast_ptr' 126 | #define reinterpret_cast_ptr reinterpret_cast | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:594:67: error: cast of an indirect pointer to an Objective-C pointer to 'unsigned int *' is disallowed with ARC 594 | void setTableSize(unsigned size) const { ASSERT(m_table); reinterpret_cast_ptr<unsigned*>(m_table)[tableSizeOffset] = size; } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:31: In file included from Source/WebKit/config.h:42: In file included from WebKitBuild/Release/usr/local/include/wtf/FastMalloc.h:26: WebKitBuild/Release/usr/local/include/wtf/StdLibExtras.h:126:30: note: expanded from macro 'reinterpret_cast_ptr' 126 | #define reinterpret_cast_ptr reinterpret_cast | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1339:9: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::setTableSize' requested here 1339 | setTableSize(bestTableSize); | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1364:19: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::HashTable' requested here 1364 | HashTable tmp(other); | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: WebKitBuild/Release/usr/local/include/wtf/HashSet.h:31:7: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::operator=' requested here 31 | class HashSet final { | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:596:65: error: cast of an indirect pointer to an Objective-C pointer to 'unsigned int *' is disallowed with ARC 596 | void setTableSizeMask(unsigned mask) { ASSERT(m_table); reinterpret_cast_ptr<unsigned*>(m_table)[tableSizeMaskOffset] = mask; } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:31: In file included from Source/WebKit/config.h:42: In file included from WebKitBuild/Release/usr/local/include/wtf/FastMalloc.h:26: WebKitBuild/Release/usr/local/include/wtf/StdLibExtras.h:126:30: note: expanded from macro 'reinterpret_cast_ptr' 126 | #define reinterpret_cast_ptr reinterpret_cast | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1340:9: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::setTableSizeMask' requested here 1340 | setTableSizeMask(bestTableSize - 1); | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1364:19: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::HashTable' requested here 1364 | HashTable tmp(other); | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: WebKitBuild/Release/usr/local/include/wtf/HashSet.h:31:7: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::operator=' requested here 31 | class HashSet final { | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:598:67: error: cast of an indirect pointer to an Objective-C pointer to 'unsigned int *' is disallowed with ARC 598 | void setKeyCount(unsigned count) const { ASSERT(m_table); reinterpret_cast_ptr<unsigned*>(m_table)[keyCountOffset] = count; } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:31: In file included from Source/WebKit/config.h:42: In file included from WebKitBuild/Release/usr/local/include/wtf/FastMalloc.h:26: WebKitBuild/Release/usr/local/include/wtf/StdLibExtras.h:126:30: note: expanded from macro 'reinterpret_cast_ptr' 126 | #define reinterpret_cast_ptr reinterpret_cast | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1341:9: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::setKeyCount' requested here 1341 | setKeyCount(otherKeyCount); | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1364:19: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::HashTable' requested here 1364 | HashTable tmp(other); | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: WebKitBuild/Release/usr/local/include/wtf/HashSet.h:31:7: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::operator=' requested here 31 | class HashSet final { | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:600:71: error: cast of an indirect pointer to an Objective-C pointer to 'unsigned int *' is disallowed with ARC 600 | void setDeletedCount(unsigned count) const { ASSERT(m_table); reinterpret_cast_ptr<unsigned*>(m_table)[deletedCountOffset] = count; } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:31: In file included from Source/WebKit/config.h:42: In file included from WebKitBuild/Release/usr/local/include/wtf/FastMalloc.h:26: WebKitBuild/Release/usr/local/include/wtf/StdLibExtras.h:126:30: note: expanded from macro 'reinterpret_cast_ptr' 126 | #define reinterpret_cast_ptr reinterpret_cast | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1342:9: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::setDeletedCount' requested here 1342 | setDeletedCount(0); | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1364:19: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::HashTable' requested here 1364 | HashTable tmp(other); | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: WebKitBuild/Release/usr/local/include/wtf/HashSet.h:31:7: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::operator=' requested here 31 | class HashSet final { | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:593:55: error: cast of an indirect pointer to an Objective-C pointer to 'unsigned int *' is disallowed with ARC 593 | unsigned tableSize() const { return m_table ? reinterpret_cast_ptr<unsigned*>(m_table)[tableSizeOffset] : 0; } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:31: In file included from Source/WebKit/config.h:42: In file included from WebKitBuild/Release/usr/local/include/wtf/FastMalloc.h:26: WebKitBuild/Release/usr/local/include/wtf/StdLibExtras.h:126:30: note: expanded from macro 'reinterpret_cast_ptr' 126 | #define reinterpret_cast_ptr reinterpret_cast | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:568:109: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::tableSize' requested here 568 | const_iterator makeConstIterator(ValueType* pos) const { return const_iterator(this, pos, m_table + tableSize()); } | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:443:67: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::makeConstIterator' requested here 443 | const_iterator begin() const { return isEmpty() ? end() : makeConstIterator(m_table); } | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1344:37: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::begin' requested here 1344 | for (const auto& otherValue : other) | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1364:19: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::HashTable' requested here 1364 | HashTable tmp(other); | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: WebKitBuild/Release/usr/local/include/wtf/HashSet.h:31:7: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::operator=' requested here 31 | class HashSet final { | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashTable.h:33: WebKitBuild/Release/usr/local/include/wtf/HashTraits.h:134:60: error: cast of 'int' to 'Class' is disallowed with ARC 134 | static bool isDeletedValue(P* value) { return value == reinterpret_cast<P*>(-1); } | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:507:81: note: in instantiation of member function 'WTF::HashTraits<Class>::isDeletedValue' requested here 507 | static bool isDeletedBucket(const ValueType& value) { return KeyTraits::isDeletedValue(Extractor::extract(value)); } | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:508:101: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::isDeletedBucket' requested here 508 | static bool isEmptyOrDeletedBucket(const ValueType& value) { return isEmptyBucket(value) || isDeletedBucket(value); } | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:140:66: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::isEmptyOrDeletedBucket' requested here 140 | while (m_position != m_endPosition && HashTableType::isEmptyOrDeletedBucket(*m_position)) | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:148:13: note: in instantiation of member function 'WTF::HashTableConstIterator<WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>, Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::skipEmptyBuckets' requested here 148 | skipEmptyBuckets(); | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:568:73: note: in instantiation of member function 'WTF::HashTableConstIterator<WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>, Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::HashTableConstIterator' requested here 568 | const_iterator makeConstIterator(ValueType* pos) const { return const_iterator(this, pos, m_table + tableSize()); } | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:443:67: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::makeConstIterator' requested here 443 | const_iterator begin() const { return isEmpty() ? end() : makeConstIterator(m_table); } | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1344:37: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::begin' requested here 1344 | for (const auto& otherValue : other) | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1364:19: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::HashTable' requested here 1364 | HashTable tmp(other); | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: WebKitBuild/Release/usr/local/include/wtf/HashSet.h:31:7: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::operator=' requested here 31 | class HashSet final { | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:595:76: error: cast of an indirect pointer to an Objective-C pointer to 'unsigned int *' is disallowed with ARC 595 | unsigned tableSizeMask() const { ASSERT(m_table); return m_table ? reinterpret_cast_ptr<unsigned*>(m_table)[tableSizeMaskOffset] : 0; } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:31: In file included from Source/WebKit/config.h:42: In file included from WebKitBuild/Release/usr/local/include/wtf/FastMalloc.h:26: WebKitBuild/Release/usr/local/include/wtf/StdLibExtras.h:126:30: note: expanded from macro 'reinterpret_cast_ptr' 126 | #define reinterpret_cast_ptr reinterpret_cast | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:733:29: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::tableSizeMask' requested here 733 | unsigned sizeMask = tableSizeMask(); | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:838:24: note: in instantiation of function template specialization 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::lookupForReinsert<WTF::IdentityHashTranslator<WTF::HashTraits<Class>, WTF::DefaultHash<Class>>, Class>' requested here 838 | Value* entry = lookupForReinsert<HashTranslator>(key); | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1345:13: note: in instantiation of function template specialization 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::addUniqueForInitialization<WTF::IdentityHashTranslator<WTF::HashTraits<Class>, WTF::DefaultHash<Class>>, const __strong Class &, (lambda at WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1345:96)>' requested here 1345 | addUniqueForInitialization<IdentityTranslatorType>(Extractor::extract(otherValue), [&]() ALWAYS_INLINE_LAMBDA { return otherValue; }); | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1364:19: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::HashTable' requested here 1364 | HashTable tmp(other); | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: WebKitBuild/Release/usr/local/include/wtf/HashSet.h:31:7: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::operator=' requested here 31 | class HashSet final { | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1169:25: error: cast of an indirect pointer to an Objective-C pointer to 'unsigned int *' is disallowed with ARC 1169 | unsigned size = reinterpret_cast_ptr<unsigned*>(table)[tableSizeOffset]; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:31: In file included from Source/WebKit/config.h:42: In file included from WebKitBuild/Release/usr/local/include/wtf/FastMalloc.h:26: WebKitBuild/Release/usr/local/include/wtf/StdLibExtras.h:126:30: note: expanded from macro 'reinterpret_cast_ptr' 126 | #define reinterpret_cast_ptr reinterpret_cast | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:425:17: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::deallocateTable' requested here 425 | deallocateTable(m_table); | ^ WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1364:19: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::~HashTable' requested here 1364 | HashTable tmp(other); | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: WebKitBuild/Release/usr/local/include/wtf/HashSet.h:31:7: note: in instantiation of member function 'WTF::HashTable<Class, Class, WTF::IdentityExtractor, WTF::DefaultHash<Class>, WTF::HashTraits<Class>, WTF::HashTraits<Class>>::operator=' requested here 31 | class HashSet final { | ^ In file included from Source/WebKit/WebProcess/Extensions/Cocoa/_WKWebExtensionWebRequestFilter.mm:36: In file included from Source/WebKit/Platform/cocoa/CocoaHelpers.h:26: In file included from WebKitBuild/Release/usr/local/include/wtf/HashSet.h:26: WebKitBuild/Release/usr/local/include/wtf/HashTable.h:1174:31: error: cast of an indirect pointer to an Objective-C pointer to 'char *' is disallowed with ARC 1174 | HashTableMalloc::free(reinterpret_cast<char*>(table) - metadataSize); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 12 errors generated.
Attachments
Add attachment
proposed patch, testcase, etc.
David Kilzer (:ddkilzer)
Comment 1
2024-08-25 08:30:05 PDT
<
rdar://134591290
>
David Kilzer (:ddkilzer)
Comment 2
2024-08-25 09:35:34 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/32684
David Kilzer (:ddkilzer)
Comment 3
2024-08-31 11:58:34 PDT
Committed
283028@main
(f61eefa):
https://commits.webkit.org/283028@main
Reviewed commits have been landed. Closing PR #32684 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug