std::once_flag must be allocated in static storage
Created attachment 410407 [details] Patch
Comment on attachment 410407 [details] Patch r=me
Comment on attachment 410407 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=410407&action=review > Source/WebCore/ChangeLog:8 > + Since std::once_flag is an usual variable, this does not prevent us from calling it multiple times. Did you mean "If the std::once_flag is a non-static variable, it will not prevent ..."?
Committed r267917: <https://trac.webkit.org/changeset/267917>
Comment on attachment 410407 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=410407&action=review >> Source/WebCore/ChangeLog:8 >> + Since std::once_flag is an usual variable, this does not prevent us from calling it multiple times. > > Did you mean "If the std::once_flag is a non-static variable, it will not prevent ..."? Fixed.
<rdar://problem/69908537>
Comment on attachment 410407 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=410407&action=review > Source/WebCore/platform/text/TextCodecSingleByte.cpp:180 > - std::once_flag once; > + static std::once_flag once; Oops, guess it was me who made this mistake. Thank you for fixing it!
Sadly, I believe this is caught by the clang static analyzer as well.