Repository navigation
Commit 2c81301
WeakListHashSetIteratorBase::get() const recurses infinitely
https://bugs.webkit.org/show_bug.cgi?id=328439
rdar://190695531
Reviewed by Yusuke Suzuki.
The const overload of WeakListHashSetIteratorBase::get() was implemented as
`return get();`. Within a const member function that resolves to the same
const overload, so the function called itself unconditionally. Since
WeakListHashSetConstIterator is only ever used through the const overloads,
calling get(), operator*() or operator->() on an iterator obtained from
begin() const, end() const or find() const overflowed the stack.
Return m_position->get() instead, matching the non-const overload.
Test: Tools/TestWebKitAPI/Tests/WTF/WeakPtr.cpp
* Source/WTF/wtf/WeakListHashSet.h:
* Tools/TestWebKitAPI/Tests/WTF/WeakPtr.cpp:
(TestWebKitAPI::TEST(WTF_WeakPtr, WeakListHashSetConstIteratorAccess)):
Canonical link: https://commits.webkit.org/324515@main1 parent 961981e commit 2c81301
2 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2796 | 2796 | | |
2797 | 2797 | | |
2798 | 2798 | | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
2799 | 2815 | | |
2800 | 2816 | | |
2801 | 2817 | | |
| |||
0 commit comments