Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 61ef996f296e2d18a6a671bdaa08c06430f50b2f
https://github.com/WebKit/WebKit/commit/61ef996f296e2d18a6a671bdaa08c06430f50b2f
Author: Ahmad Saleem <[email protected]>
Date: 2026-07-13 (Mon, 13 Jul 2026)
Changed paths:
M Source/WTF/wtf/text/StringConcatenate.h
Log Message:
-----------
[WTF] Use std::ranges::fill for the fill loops in StringConcatenate
padding/indentation adapters
https://bugs.webkit.org/show_bug.cgi?id=318766
rdar://problem/181625114
Reviewed by Chris Dumez.
The PaddingSpecification and Indentation StringTypeAdapters both filled
their characters with std::fill_n(destination.data(), ...). Calling
data() strips the bounds off the span and hands the fill a raw pointer,
which defeats the memory-safety the span provides (and is the pattern
the unsafe-buffer warning targets).
Switch both to std::ranges::fill over a bounded subspan
(destination.first(count)) so the fills read as a single clear statement
and stay memory-safe: the span carries its length, so we never hand a
raw pointer to the fill.
* Source/WTF/wtf/text/StringConcatenate.h:
(WTF::StringTypeAdapter<PaddingSpecification<UnderlyingElementType>>::writeTo
const):
(WTF::StringTypeAdapter<Indentation<N>>::writeTo const):
Canonical link: https://commits.webkit.org/317049@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications