[webkit-changes] [WebKit/WebKit] 00e4ae: [WTF] Narrow scope of ignored -Wunsafe-buffer-usag...
Commit Queue
noreply at github.com
Fri Oct 18 16:12:28 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 00e4ae32b87a36717be7ed03a9f62cf6bdc456ce
https://github.com/WebKit/WebKit/commit/00e4ae32b87a36717be7ed03a9f62cf6bdc456ce
Author: David Kilzer <ddkilzer at apple.com>
Date: 2024-10-18 (Fri, 18 Oct 2024)
Changed paths:
M Source/JavaScriptCore/runtime/IntlCollator.cpp
M Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
M Source/JavaScriptCore/runtime/IntlLocale.cpp
M Source/JavaScriptCore/runtime/IntlObject.cpp
M Source/JavaScriptCore/runtime/IntlPluralRules.cpp
M Source/JavaScriptCore/runtime/JSONObject.cpp
M Source/JavaScriptCore/tools/FunctionAllowlist.cpp
M Source/JavaScriptCore/tools/FunctionOverrides.cpp
M Source/WTF/wtf/StdLibExtras.h
M Source/WTF/wtf/text/ASCIILiteral.h
M Source/WTF/wtf/text/SuperFastHash.h
M Tools/WebKitTestRunner/TestController.cpp
Log Message:
-----------
[WTF] Narrow scope of ignored -Wunsafe-buffer-usage warnings from ASCIILiteral.h to SuperFastHash.h
<https://bugs.webkit.org/show_bug.cgi?id=281506>
<rdar://137973769>
Reviewed by Geoffrey Garen.
Additional changes in JavaScriptCore and WebKitTestRunner were due to
temporarily introducing an overloaded ASCIILiteral::fromLiteralUnsafe()
with a second size_t argument, which was later removed. This caused a
disambiguation build failure on gcc, but these changes will be needed
later anyway, so they were kept.
* Source/WTF/wtf/text/ASCIILiteral.h:
- Move WTF_ALLOW_UNSAFE_BUFFER_USAGE_{BEGIN,END} macros to
SuperFastHash.h.
(WTF::ASCIILiteral::fromLiteralUnsafe):
- Move call to std::char_traits<char>::length() into this method from
the ASCIILiteral constructor.
- Construct a std::span that includes NUL terminator byte using
unsafeForgeSpan() now that the ASCIILiteral constructor takes a
std::span.
(WTF::ASCIILiteral::span8):
- Use std::span::first() to fix unsafe buffer usage warning.
(WTF::ASCIILiteral::ASCIILiteral):
- Change to take a std::span argument that includes the NUL terminator
byte.
- Fix indentation of code in ASSERT_ENABLED.
(WTF::StringLiterals::operator"" _span):
- Create std::span first, then use that to check characters in Debug
builds. This fixes an unsafe buffer usage warning.
- Use unsafeForgeSpan() to silence false positive warning.
* Source/WTF/wtf/StdLibExtras.h:
(WTF::spanReinterpretCast):
- Make constexpr by updating release assertion.
(WTF::unsafeForgeSpan):
- Make constexpr.
* Source/WTF/wtf/text/SuperFastHash.h:
- Move WTF_ALLOW_UNSAFE_BUFFER_USAGE_{BEGIN,END} macros to this header.
* Source/JavaScriptCore/runtime/IntlCollator.cpp:
(JSC::IntlCollator::sortLocaleData):
* Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::localeData):
* Source/JavaScriptCore/runtime/IntlLocale.cpp:
(JSC::IntlLocale::calendars):
(JSC::IntlLocale::collations):
* Source/JavaScriptCore/runtime/IntlObject.cpp:
(JSC::intlAvailableCalendars):
(JSC::availableCollations):
(JSC::availableCurrencies):
(JSC::intlAvailableTimeZones):
* Source/JavaScriptCore/runtime/IntlPluralRules.cpp:
(JSC::IntlPluralRules::resolvedOptions const):
* Source/JavaScriptCore/runtime/JSONObject.cpp:
(JSC::gap):
- Construct std::span safely from C-array, then use first().
* Source/JavaScriptCore/tools/FunctionAllowlist.cpp:
(JSC::FunctionAllowlist::FunctionAllowlist):
* Source/JavaScriptCore/tools/FunctionOverrides.cpp:
(JSC::parseClause):
- Make use of unsafeForgeSpan(), except where noted above. Many of
these are after a call to uenum_next().
* Tools/WebKitTestRunner/TestController.cpp:
(WTR::TestController::createTestURL):
- Convert std::string directly to std::span.
Canonical link: https://commits.webkit.org/285440@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list