Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit f1a5cb2

Browse files
Add extra validation to MetaAllocator::findAndRemoveFreeSpace
https://bugs.webkit.org/show_bug.cgi?id=217792 <rdar://problem/69433015> Reviewed Saam Barati. * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::findAndRemoveFreeSpace): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@269019 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 1b8a8b2 commit f1a5cb2

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Source/WTF/ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2020-10-15 Tadeu Zagallo <[email protected]>
2+
3+
Add extra validation to MetaAllocator::findAndRemoveFreeSpace
4+
https://bugs.webkit.org/show_bug.cgi?id=217792
5+
<rdar://problem/69433015>
6+
7+
Reviewed Saam Barati.
8+
9+
* wtf/MetaAllocator.cpp:
10+
(WTF::MetaAllocator::findAndRemoveFreeSpace):
11+
112
2020-10-13 Tadeu Zagallo <[email protected]>
213

314
Assert that WTF::HashTable does not visit the same bucket twice

Source/WTF/wtf/MetaAllocator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ MetaAllocator::FreeSpacePtr MetaAllocator::findAndRemoveFreeSpace(size_t sizeInB
211211
return nullptr;
212212

213213
size_t nodeSizeInBytes = node->sizeInBytes();
214-
ASSERT(nodeSizeInBytes >= sizeInBytes);
214+
RELEASE_ASSERT(nodeSizeInBytes >= sizeInBytes);
215215

216216
m_freeSpaceSizeMap.remove(node);
217217

@@ -246,6 +246,7 @@ MetaAllocator::FreeSpacePtr MetaAllocator::findAndRemoveFreeSpace(size_t sizeInB
246246
m_freeSpaceStartAddressMap.remove(node->m_start);
247247

248248
node->m_start += sizeInBytes;
249+
RELEASE_ASSERT(nodeStartAsInt < node->m_start.untaggedPtr<uintptr_t>() && node->m_start.untaggedPtr<uintptr_t>() < node->m_end.untaggedPtr<uintptr_t>());
249250

250251
m_freeSpaceSizeMap.insert(node);
251252
m_freeSpaceStartAddressMap.add(node->m_start, node);

0 commit comments

Comments
 (0)