Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1ab6226d0714c683a76810fa340e29c48856faa1
      
https://github.com/WebKit/WebKit/commit/1ab6226d0714c683a76810fa340e29c48856faa1
  Author: Chris Dumez <[email protected]>
  Date:   2025-01-28 (Tue, 28 Jan 2025)

  Changed paths:
    M Source/JavaScriptCore/runtime/JSStringInlines.h
    M Source/JavaScriptCore/runtime/JSStringJoiner.cpp
    M Source/JavaScriptCore/runtime/StringConstructor.cpp
    M Source/JavaScriptCore/runtime/StringPrototype.cpp
    M Source/WTF/wtf/HexNumber.h
    M Source/WTF/wtf/URLHelpers.cpp
    M Source/WTF/wtf/text/StringBuilder.cpp
    M Source/WTF/wtf/text/StringBuilderInternals.h
    M Source/WTF/wtf/text/StringConcatenate.h
    M Source/WTF/wtf/text/StringConcatenateNumbers.h
    M Source/WTF/wtf/text/StringImpl.cpp
    M Source/WTF/wtf/text/StringImpl.h
    M Source/WTF/wtf/text/StringView.h
    M Source/WTF/wtf/text/WTFString.cpp
    M Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp

  Log Message:
  -----------
  Update StringImpl::copyCharacters() to take spans and do bounds validation
https://bugs.webkit.org/show_bug.cgi?id=286435

Reviewed by Darin Adler.

Also fix an issue in `JSRopeString::resolveToBuffer()` where we were 
artificially
reducing the size of the output buffer we were passing to 
`StringView::getCharacters()`
as it was tripping the subspan assertions. The code was safe since the buffer 
was large
enough, however, `StringView::getCharacters()` could not know that.

Note that the assertions are only debug assertions for now due to performance 
concerns
but we should try and make them release assertions wherever performance allows. 
The
assertions are currently in StringImpl::copyCharacters() but I intend to move 
them
to copyElements() in a follow-up as this requires even more refactoring.

* Source/JavaScriptCore/runtime/JSStringJoiner.cpp:
(JSC::appendStringToData):
* Source/JavaScriptCore/runtime/StringConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/StringPrototype.cpp:
(JSC::jsSpliceSubstrings):
* Source/WTF/wtf/HexNumber.h:
(WTF::StringTypeAdapter<HexNumberBuffer>::writeTo const):
* Source/WTF/wtf/URLHelpers.cpp:
(WTF::URLHelpers::escapeUnsafeCharacters):
* Source/WTF/wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::append):
* Source/WTF/wtf/text/StringBuilderInternals.h:
(WTF::StringBuilder::allocateBuffer):
* Source/WTF/wtf/text/StringConcatenate.h:
* Source/WTF/wtf/text/StringConcatenateNumbers.h:
(WTF::StringTypeAdapter<FormattedNumber>::writeTo const):
(WTF::StringTypeAdapter<FormattedCSSNumber>::writeTo const):
* Source/WTF/wtf/text/StringImpl.cpp:
(WTF::StringImpl::createInternal):
(WTF::StringImpl::foldCase):
(WTF::StringImpl::convertASCIICase):
(WTF::StringImpl::replace):
* Source/WTF/wtf/text/StringImpl.h:
(WTF::StringImpl::copyCharacters):
(WTF::StringImpl::removeCharactersImpl):
(WTF::StringImpl::createByReplacingInCharacters):
* Source/WTF/wtf/text/StringView.h:
(WTF::StringView::getCharacters8 const):
(WTF::StringView::getCharacters16 const):
(WTF::StringView::UpconvertedCharactersWithSize<N>::UpconvertedCharactersWithSize):
* Source/WTF/wtf/text/WTFString.cpp:
(WTF::String::make8Bit):
(WTF::String::convertTo16Bit):
* Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp:
(WTF::uTextLatin1Access):
(WTF::uTextLatin1Extract):
(WTF::textLatin1ContextAwareMoveInPrimaryContext):

Canonical link: https://commits.webkit.org/289466@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to