diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2017-11-21 10:27:09 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2017-11-21 10:27:09 +0300 |
commit | 9ccbb8b53bffc27420ad8b360c581668bb8837bd (patch) | |
tree | b7d67963d3a25cb4d4854572a82d70c66af01fa1 /debian/patches/fix_copyChars_segfault.diff | |
parent | 4d58bc068bed0c9c6a976c4641ec799dd91e153b (diff) | |
parent | e03edf7c770d2531e731bcc69663d985c12185dd (diff) | |
download | qt5webkit-9ccbb8b53bffc27420ad8b360c581668bb8837bd.tar.gz |
Merge branch 'master' of https://anonscm.debian.org/git/pkg-kde/qt/qt5webkit
Diffstat (limited to 'debian/patches/fix_copyChars_segfault.diff')
-rw-r--r-- | debian/patches/fix_copyChars_segfault.diff | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/debian/patches/fix_copyChars_segfault.diff b/debian/patches/fix_copyChars_segfault.diff new file mode 100644 index 0000000..1c704f3 --- /dev/null +++ b/debian/patches/fix_copyChars_segfault.diff @@ -0,0 +1,43 @@ +Description: fix WTF::StringImpl::copyChars segfault when built with GCC 7 +Origin: upstream, https://github.com/annulen/webkit/commit/0caec8a593cd872e +Last-Update: 2017-10-27 + +--- a/Source/WTF/wtf/text/StringImpl.h ++++ b/Source/WTF/wtf/text/StringImpl.h +@@ -619,25 +619,7 @@ + *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<const uint32_t*>(source); +- uint32_t* destCharacters = reinterpret_cast<uint32_t*>(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 @@ + return *tailPointer<StringImpl*>(); + } + +- // 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<CaseConvertType type, typename CharacterType> static Ref<StringImpl> convertASCIICase(StringImpl&, const CharacterType*, unsigned); + |