There are two problems with it: 1) It calls BitVector::clearAll(), which does not free any memory. Instead, it should call BitVector::~BitVector(), then do a placement new of a fresh BitVector (to get it back to its inline condition) 2) More problematically, it changes m_size before calling isBitVector() which relies crucially on the value of m_size. So it is going to believe that it is in BitVector mode even when it is actually in HashSet mode.
rdar://78607433
Created attachment 430037 [details] Patch
Comment on attachment 430037 [details] Patch r=me
Comment on attachment 430037 [details] Patch Thanks for the review. Landing this as the wincairo failure is very clearly unrelated.
Committed r278224 (238262@main): <https://commits.webkit.org/238262@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 430037 [details].