From: Debian Qt/KDE Maintainers Date: Tue, 9 Jan 2018 15:38:23 +0000 (+0000) Subject: fix_copyChars_segfault X-Git-Tag: archive/raspbian/5.212.0_alpha2-6+rpi1~4^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=07601a90086ab06da9a27a237b1bbedf51801870;p=qtwebkit-opensource-src.git fix_copyChars_segfault Gbp-Pq: Name fix_copyChars_segfault.diff --- diff --git a/Source/WTF/wtf/text/StringImpl.h b/Source/WTF/wtf/text/StringImpl.h index 5781c1c0..a1be7563 100644 --- a/Source/WTF/wtf/text/StringImpl.h +++ b/Source/WTF/wtf/text/StringImpl.h @@ -619,25 +619,7 @@ public: *destination = *source; return; } - - if (numCharacters <= s_copyCharsInlineCutOff) { - unsigned i = 0; -#if (CPU(X86) || CPU(X86_64)) - const unsigned charsPerInt = sizeof(uint32_t) / sizeof(T); - - if (numCharacters > charsPerInt) { - unsigned stopCount = numCharacters & ~(charsPerInt - 1); - - const uint32_t* srcCharacters = reinterpret_cast(source); - uint32_t* destCharacters = reinterpret_cast(destination); - for (unsigned j = 0; i < stopCount; i += charsPerInt, ++j) - destCharacters[j] = srcCharacters[j]; - } -#endif - for (; i < numCharacters; ++i) - destination[i] = source[i]; - } else - memcpy(destination, source, numCharacters * sizeof(T)); + memcpy(destination, source, numCharacters * sizeof(T)); } ALWAYS_INLINE static void copyChars(UChar* destination, const LChar* source, unsigned numCharacters) @@ -855,9 +837,6 @@ private: return *tailPointer(); } - // This number must be at least 2 to avoid sharing empty, null as well as 1 character strings from SmallStrings. - static const unsigned s_copyCharsInlineCutOff = 20; - enum class CaseConvertType { Upper, Lower }; template static Ref convertASCIICase(StringImpl&, const CharacterType*, unsigned);