QtWebKit: fix segfaults when built with GCC 7

This commit is contained in:
Gerasim Troeglazov
2018-06-14 00:22:33 +10:00
parent 03cbe0858a
commit 1e9c41f8f5
2 changed files with 52 additions and 1 deletions

View File

@@ -1250,3 +1250,54 @@ index 0fcd4df..6672ce3 100644
--
2.16.4
From a36365c33c489c8fe5b44f1bfa62a23cbd9e7fc5 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 13 Jun 2018 21:24:48 +1000
Subject: WTF::StringImpl::copyChars segfaults when built with GCC 7
diff --git a/Source/WTF/wtf/text/StringImpl.h b/Source/WTF/wtf/text/StringImpl.h
index 5781c1c..a1be756 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<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 @@ private:
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);
--
2.16.4

View File

@@ -10,7 +10,7 @@ HOMEPAGE="https://github.com/annulen/webkit"
COPYRIGHT="2015-2017 The Qt Company Ltd."
LICENSE="GNU LGPL v2.1
GNU LGPL v3"
REVISION="11"
REVISION="12"
SOURCE_URI="https://github.com/annulen/webkit/releases/download/qtwebkit-${portVersion/\~/-}/qtwebkit-${portVersion/\~/-}.tar.xz"
CHECKSUM_SHA256="f8f901de567e11fc5659402b6b827eac75505ff9c5072d8e919aa306003f8f8a"
SOURCE_DIR="qtwebkit-${portVersion/\~/-}"