Skip to content
Permalink
Browse files
False positive warning when building RefCounter test with GCC 12
https://bugs.webkit.org/show_bug.cgi?id=239338

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2022-05-13
Reviewed by Chris Dumez.

* Source/WTF/wtf/RefCounter.h:
(WTF::RefCounter<T>::Count::deref):

Canonical link: https://commits.webkit.org/250527@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
mcatanzaro authored and webkit-commit-queue committed May 13, 2022
1 parent bc49d96 commit 953c4f7979d773c3b2d06a8fe7fc44ba13deef8a
Showing with 14 additions and 0 deletions.
  1. +11 −0 Source/WTF/ChangeLog
  2. +3 −0 Source/WTF/wtf/RefCounter.h
@@ -1,3 +1,14 @@
2022-05-12 Michael Catanzaro <mcatanzaro@redhat.com>

False positive warning when building RefCounter test with GCC 12
https://bugs.webkit.org/show_bug.cgi?id=239338
<rdar://problem/93204514>

Reviewed by Chris Dumez.

* wtf/RefCounter.h:
(WTF::RefCounter<T>::Count::deref):

2022-05-12 Michael Catanzaro <mcatanzaro@redhat.com>

-Wattributes warnings from AtomString.cpp and WTFString.cpp
@@ -96,12 +96,15 @@ inline void RefCounter<T>::Count::deref()
{
ASSERT(m_value);

// GCC gets confused here, see https://webkit.org/b/239338.
IGNORE_GCC_WARNINGS_BEGIN("use-after-free")
--m_value;

if (m_refCounter && m_refCounter->m_valueDidChange) {
SetForScope inCallback(m_inValueDidChange, true);
m_refCounter->m_valueDidChange(RefCounterEvent::Decrement);
}
IGNORE_GCC_WARNINGS_END

// The Count object is kept alive so long as either the RefCounter that created it remains
// allocated, or so long as its reference count is non-zero.

0 comments on commit 953c4f7

Please sign in to comment.