Update release*() functions on ExceptionOr() to always release the member, instead of simply doing a cast and leaving it up to the call site.
In addition to this good change, I still think we might *also* want to add an assertion to make sure we never double-release.
(In reply to Darin Adler from comment #1) > In addition to this good change, I still think we might *also* want to add > an assertion to make sure we never double-release. Working on it. I ran the tests and it actually found a bug :S
Created attachment 405302 [details] Patch
Comment on attachment 405302 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=405302&action=review > Source/WebCore/dom/ExceptionOr.h:140 > + ASSERT(!m_wasReleased); > +#if ASSERT_ENABLED > + m_wasReleased = true; > +#endif I have a horrible/great idea: ASSERT(!std::exchnage(m_wasReleased, true));
(In reply to Darin Adler from comment #4) > Comment on attachment 405302 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=405302&action=review > > > Source/WebCore/dom/ExceptionOr.h:140 > > + ASSERT(!m_wasReleased); > > +#if ASSERT_ENABLED > > + m_wasReleased = true; > > +#endif > > I have a horrible/great idea: > > ASSERT(!std::exchnage(m_wasReleased, true)); Not super readable but this is way more concise and avoid the #if. I'll do it.
Created attachment 405305 [details] Patch
(In reply to Chris Dumez from comment #5) > Not super readable but this is way more concise and avoid the #if. I'll do > it. Glad you decided to use it. I guessed that you would see both the horrible side and the great side.
Bots are not happy. Looks like this may have found another bug in IDB.
(In reply to Chris Dumez from comment #8) > Bots are not happy. Looks like this may have found another bug in IDB. Or maybe not. I see the same IDB failures on another patch.. Tree is likely red.
Created attachment 405313 [details] Patch
Committed r264958: <https://trac.webkit.org/changeset/264958> All reviewed patches have been landed. Closing bug and clearing flags on attachment 405313 [details].
<rdar://problem/66189892>