Bug 239340 - -Wstringop-overflow warning in DocumentWriter.cpp
Summary: -Wstringop-overflow warning in DocumentWriter.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-14 09:14 PDT by Michael Catanzaro
Modified: 2022-05-13 10:59 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2022-04-14 09:14:35 PDT
-Wstringop-overflow warnings are *usually* false positives. I will need to look closer at this one:

[3703/6690] Building CXX object Source/WebCore/CMakeFiles/...ivedSources/unified-sources/UnifiedSource-c57e08af-2.cpp.o
In file included from /usr/include/c++/12/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/12/memory:78,
                 from /home/mcatanzaro/Projects/WebKit/WebKitBuild/GNOME-gtk3/WTF/Headers/wtf/StdLibExtras.h:30,
                 from /home/mcatanzaro/Projects/WebKit/WebKitBuild/GNOME-gtk3/WTF/Headers/wtf/FastMalloc.h:26,
                 from /home/mcatanzaro/Projects/WebKit/Source/WebCore/config.h:56,
                 from /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/CrossOriginPreflightResultCache.cpp:27,
                 from /home/mcatanzaro/Projects/WebKit/WebKitBuild/GNOME-gtk3/WebCore/DerivedSources/unified-sources/UnifiedSource-c57e08af-2.cpp:1:
In member function ‘std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator++() [with _ITp = unsigned int]’,
    inlined from ‘void WTF::ThreadSafeRefCountedBase::ref() const’ at /home/mcatanzaro/Projects/WebKit/WebKitBuild/GNOME-gtk3/WTF/Headers/wtf/ThreadSafeRefCounted.h:60:9,
    inlined from ‘WTF::Ref<T, <template-parameter-1-2> >::Ref(T&) [with T = WebCore::Frame; Traits = WTF::RawPtrTraits<WebCore::Frame>]’ at /home/mcatanzaro/Projects/WebKit/WebKitBuild/GNOME-gtk3/WTF/Headers/wtf/Ref.h:67:19,
    inlined from ‘void WebCore::DocumentWriter::end()’ at /home/mcatanzaro/Projects/WebKit/Source/WebCore/loader/DocumentWriter.cpp:299:32:
/usr/include/c++/12/bits/atomic_base.h:385:34: warning: ‘unsigned int __atomic_add_fetch_4(volatile void*, unsigned int, int)’ writing 4 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
  385 |       { return __atomic_add_fetch(&_M_i, 1, int(memory_order_seq_cst)); }
      |                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment 1 Michael Catanzaro 2022-05-13 07:40:46 PDT
If there's anything wrong with this code, there is no way to know it from this nonsense. I will suppress it.
Comment 2 Radar WebKit Bug Importer 2022-05-13 07:40:55 PDT
<rdar://problem/93243931>
Comment 3 Michael Catanzaro 2022-05-13 07:47:42 PDT
Pull request: https://github.com/WebKit/WebKit/pull/609
Comment 4 EWS 2022-05-13 10:59:28 PDT
Committed r294164 (250533@main): <https://commits.webkit.org/250533@main>

Reviewed commits have been landed. Closing PR #609 and removing active labels.