Date: Tue, 8 Nov 2016 13:11:31 +0000 (UTC) From: Jan Beich <jbeich@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r425738 - in branches/2016Q4: mail/thunderbird mail/thunderbird/files www/firefox www/firefox-esr www/firefox-esr/files www/firefox/files www/libxul www/libxul/files www/seamonkey www/s... Message-ID: <201611081311.uA8DBV6u011107@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Tue Nov 8 13:11:31 2016 New Revision: 425738 URL: https://svnweb.freebsd.org/changeset/ports/425738 Log: MFH: r425733 gecko: backport fix for crash on 9.x (lang/gcc5 + -O3) https://lists.freebsd.org/pipermail/freebsd-gecko/2016-November/006752.html https://bugzilla.mozilla.org/show_bug.cgi?id=757366 Approved by: ports-secteam blanket Added: branches/2016Q4/mail/thunderbird/files/patch-bug757366 - copied unchanged from r425733, head/mail/thunderbird/files/patch-bug757366 branches/2016Q4/www/firefox-esr/files/patch-bug757366 - copied unchanged from r425733, head/www/firefox-esr/files/patch-bug757366 branches/2016Q4/www/firefox/files/patch-bug757366 - copied unchanged from r425733, head/www/firefox/files/patch-bug757366 branches/2016Q4/www/libxul/files/patch-bug757366 - copied unchanged from r425733, head/www/libxul/files/patch-bug757366 branches/2016Q4/www/seamonkey/files/patch-bug757366 - copied unchanged from r425733, head/www/seamonkey/files/patch-bug757366 Modified: branches/2016Q4/mail/thunderbird/Makefile branches/2016Q4/www/firefox-esr/Makefile branches/2016Q4/www/firefox/Makefile branches/2016Q4/www/libxul/Makefile branches/2016Q4/www/seamonkey/Makefile Directory Properties: branches/2016Q4/ (props changed) Modified: branches/2016Q4/mail/thunderbird/Makefile ============================================================================== --- branches/2016Q4/mail/thunderbird/Makefile Tue Nov 8 13:01:42 2016 (r425737) +++ branches/2016Q4/mail/thunderbird/Makefile Tue Nov 8 13:11:31 2016 (r425738) @@ -3,6 +3,7 @@ PORTNAME= thunderbird DISTVERSION= 45.4.0 +PORTREVISION= 1 CATEGORIES= mail news net-im ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source Copied: branches/2016Q4/mail/thunderbird/files/patch-bug757366 (from r425733, head/mail/thunderbird/files/patch-bug757366) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q4/mail/thunderbird/files/patch-bug757366 Tue Nov 8 13:11:31 2016 (r425738, copy of r425733, head/mail/thunderbird/files/patch-bug757366) @@ -0,0 +1,58 @@ +commit 2a3be4b384b9 +Author: Jonathan Kew <jkew@mozilla.com> +Date: Mon Sep 26 18:05:14 2016 +0100 + + Bug 757366 - Don't cast pointers to 'name'-table data to uint16_t*, as they may not be 16-bit-aligned. r=jrmuizel +--- + gfx/thebes/gfxFontUtils.cpp | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +diff --git gfx/thebes/gfxFontUtils.cpp gfx/thebes/gfxFontUtils.cpp +index 526e17d..cb505e8 100644 +--- mozilla/gfx/thebes/gfxFontUtils.cpp ++++ mozilla/gfx/thebes/gfxFontUtils.cpp +@@ -918,16 +918,18 @@ IsValidSFNTVersion(uint32_t version) + version == TRUETYPE_TAG('t','r','u','e'); + } + +-// copy and swap UTF-16 values, assume no surrogate pairs, can be in place ++// Copy and swap UTF-16 values, assume no surrogate pairs, can be in place. ++// aInBuf and aOutBuf are NOT necessarily 16-bit-aligned, so we should avoid ++// accessing them directly as uint16_t* values. ++// aLen is count of UTF-16 values, so the byte buffers are twice that. + static void +-CopySwapUTF16(const uint16_t *aInBuf, uint16_t *aOutBuf, uint32_t aLen) ++CopySwapUTF16(const char* aInBuf, char* aOutBuf, uint32_t aLen) + { +- const uint16_t *end = aInBuf + aLen; ++ const char* end = aInBuf + aLen * 2; + while (aInBuf < end) { +- uint16_t value = *aInBuf; +- *aOutBuf = (value >> 8) | (value & 0xff) << 8; +- aOutBuf++; +- aInBuf++; ++ uint8_t b0 = *aInBuf++; ++ *aOutBuf++ = *aInBuf++; ++ *aOutBuf++ = b0; + } + } + +@@ -1446,13 +1448,13 @@ gfxFontUtils::DecodeFontName(const char *aNameData, int32_t aByteLen, + if (csName[0] == 0) { + // empty charset name: data is utf16be, no need to instantiate a converter + uint32_t strLen = aByteLen / 2; +-#ifdef IS_LITTLE_ENDIAN + aName.SetLength(strLen); +- CopySwapUTF16(reinterpret_cast<const uint16_t*>(aNameData), +- reinterpret_cast<uint16_t*>(aName.BeginWriting()), strLen); ++#ifdef IS_LITTLE_ENDIAN ++ CopySwapUTF16(aNameData, reinterpret_cast<char*>(aName.BeginWriting()), ++ strLen); + #else +- aName.Assign(reinterpret_cast<const char16_t*>(aNameData), strLen); +-#endif ++ memcpy(aName.BeginWriting(), aNameData, strLen * 2); ++#endif + return true; + } + Modified: branches/2016Q4/www/firefox-esr/Makefile ============================================================================== --- branches/2016Q4/www/firefox-esr/Makefile Tue Nov 8 13:01:42 2016 (r425737) +++ branches/2016Q4/www/firefox-esr/Makefile Tue Nov 8 13:11:31 2016 (r425738) @@ -4,7 +4,7 @@ PORTNAME= firefox DISTVERSION= 45.4.0 DISTVERSIONSUFFIX=esr.source -PORTREVISION= 5 +PORTREVISION= 6 PORTEPOCH= 1 CATEGORIES= www ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}esr/source \ Copied: branches/2016Q4/www/firefox-esr/files/patch-bug757366 (from r425733, head/www/firefox-esr/files/patch-bug757366) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q4/www/firefox-esr/files/patch-bug757366 Tue Nov 8 13:11:31 2016 (r425738, copy of r425733, head/www/firefox-esr/files/patch-bug757366) @@ -0,0 +1,58 @@ +commit 2a3be4b384b9 +Author: Jonathan Kew <jkew@mozilla.com> +Date: Mon Sep 26 18:05:14 2016 +0100 + + Bug 757366 - Don't cast pointers to 'name'-table data to uint16_t*, as they may not be 16-bit-aligned. r=jrmuizel +--- + gfx/thebes/gfxFontUtils.cpp | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +diff --git gfx/thebes/gfxFontUtils.cpp gfx/thebes/gfxFontUtils.cpp +index 526e17d..cb505e8 100644 +--- gfx/thebes/gfxFontUtils.cpp ++++ gfx/thebes/gfxFontUtils.cpp +@@ -918,16 +918,18 @@ IsValidSFNTVersion(uint32_t version) + version == TRUETYPE_TAG('t','r','u','e'); + } + +-// copy and swap UTF-16 values, assume no surrogate pairs, can be in place ++// Copy and swap UTF-16 values, assume no surrogate pairs, can be in place. ++// aInBuf and aOutBuf are NOT necessarily 16-bit-aligned, so we should avoid ++// accessing them directly as uint16_t* values. ++// aLen is count of UTF-16 values, so the byte buffers are twice that. + static void +-CopySwapUTF16(const uint16_t *aInBuf, uint16_t *aOutBuf, uint32_t aLen) ++CopySwapUTF16(const char* aInBuf, char* aOutBuf, uint32_t aLen) + { +- const uint16_t *end = aInBuf + aLen; ++ const char* end = aInBuf + aLen * 2; + while (aInBuf < end) { +- uint16_t value = *aInBuf; +- *aOutBuf = (value >> 8) | (value & 0xff) << 8; +- aOutBuf++; +- aInBuf++; ++ uint8_t b0 = *aInBuf++; ++ *aOutBuf++ = *aInBuf++; ++ *aOutBuf++ = b0; + } + } + +@@ -1446,13 +1448,13 @@ gfxFontUtils::DecodeFontName(const char *aNameData, int32_t aByteLen, + if (csName[0] == 0) { + // empty charset name: data is utf16be, no need to instantiate a converter + uint32_t strLen = aByteLen / 2; +-#ifdef IS_LITTLE_ENDIAN + aName.SetLength(strLen); +- CopySwapUTF16(reinterpret_cast<const uint16_t*>(aNameData), +- reinterpret_cast<uint16_t*>(aName.BeginWriting()), strLen); ++#ifdef IS_LITTLE_ENDIAN ++ CopySwapUTF16(aNameData, reinterpret_cast<char*>(aName.BeginWriting()), ++ strLen); + #else +- aName.Assign(reinterpret_cast<const char16_t*>(aNameData), strLen); +-#endif ++ memcpy(aName.BeginWriting(), aNameData, strLen * 2); ++#endif + return true; + } + Modified: branches/2016Q4/www/firefox/Makefile ============================================================================== --- branches/2016Q4/www/firefox/Makefile Tue Nov 8 13:01:42 2016 (r425737) +++ branches/2016Q4/www/firefox/Makefile Tue Nov 8 13:11:31 2016 (r425738) @@ -4,6 +4,7 @@ PORTNAME= firefox DISTVERSION= 49.0.2 DISTVERSIONSUFFIX=.source +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= www ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ Copied: branches/2016Q4/www/firefox/files/patch-bug757366 (from r425733, head/www/firefox/files/patch-bug757366) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q4/www/firefox/files/patch-bug757366 Tue Nov 8 13:11:31 2016 (r425738, copy of r425733, head/www/firefox/files/patch-bug757366) @@ -0,0 +1,58 @@ +commit 2a3be4b384b9 +Author: Jonathan Kew <jkew@mozilla.com> +Date: Mon Sep 26 18:05:14 2016 +0100 + + Bug 757366 - Don't cast pointers to 'name'-table data to uint16_t*, as they may not be 16-bit-aligned. r=jrmuizel +--- + gfx/thebes/gfxFontUtils.cpp | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +diff --git gfx/thebes/gfxFontUtils.cpp gfx/thebes/gfxFontUtils.cpp +index 526e17d..cb505e8 100644 +--- gfx/thebes/gfxFontUtils.cpp ++++ gfx/thebes/gfxFontUtils.cpp +@@ -918,16 +918,18 @@ IsValidSFNTVersion(uint32_t version) + version == TRUETYPE_TAG('t','r','u','e'); + } + +-// copy and swap UTF-16 values, assume no surrogate pairs, can be in place ++// Copy and swap UTF-16 values, assume no surrogate pairs, can be in place. ++// aInBuf and aOutBuf are NOT necessarily 16-bit-aligned, so we should avoid ++// accessing them directly as uint16_t* values. ++// aLen is count of UTF-16 values, so the byte buffers are twice that. + static void +-CopySwapUTF16(const uint16_t *aInBuf, uint16_t *aOutBuf, uint32_t aLen) ++CopySwapUTF16(const char* aInBuf, char* aOutBuf, uint32_t aLen) + { +- const uint16_t *end = aInBuf + aLen; ++ const char* end = aInBuf + aLen * 2; + while (aInBuf < end) { +- uint16_t value = *aInBuf; +- *aOutBuf = (value >> 8) | (value & 0xff) << 8; +- aOutBuf++; +- aInBuf++; ++ uint8_t b0 = *aInBuf++; ++ *aOutBuf++ = *aInBuf++; ++ *aOutBuf++ = b0; + } + } + +@@ -1446,13 +1448,13 @@ gfxFontUtils::DecodeFontName(const char *aNameData, int32_t aByteLen, + if (csName[0] == 0) { + // empty charset name: data is utf16be, no need to instantiate a converter + uint32_t strLen = aByteLen / 2; +-#ifdef IS_LITTLE_ENDIAN + aName.SetLength(strLen); +- CopySwapUTF16(reinterpret_cast<const uint16_t*>(aNameData), +- reinterpret_cast<uint16_t*>(aName.BeginWriting()), strLen); ++#ifdef IS_LITTLE_ENDIAN ++ CopySwapUTF16(aNameData, reinterpret_cast<char*>(aName.BeginWriting()), ++ strLen); + #else +- aName.Assign(reinterpret_cast<const char16_t*>(aNameData), strLen); +-#endif ++ memcpy(aName.BeginWriting(), aNameData, strLen * 2); ++#endif + return true; + } + Modified: branches/2016Q4/www/libxul/Makefile ============================================================================== --- branches/2016Q4/www/libxul/Makefile Tue Nov 8 13:01:42 2016 (r425737) +++ branches/2016Q4/www/libxul/Makefile Tue Nov 8 13:11:31 2016 (r425738) @@ -3,7 +3,7 @@ PORTNAME= libxul DISTVERSION= 45.4.0 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES?= www devel MASTER_SITES= MOZILLA/firefox/releases/${DISTVERSION}esr/source \ MOZILLA/firefox/candidates/${DISTVERSION}esr-candidates/build2/source Copied: branches/2016Q4/www/libxul/files/patch-bug757366 (from r425733, head/www/libxul/files/patch-bug757366) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q4/www/libxul/files/patch-bug757366 Tue Nov 8 13:11:31 2016 (r425738, copy of r425733, head/www/libxul/files/patch-bug757366) @@ -0,0 +1,58 @@ +commit 2a3be4b384b9 +Author: Jonathan Kew <jkew@mozilla.com> +Date: Mon Sep 26 18:05:14 2016 +0100 + + Bug 757366 - Don't cast pointers to 'name'-table data to uint16_t*, as they may not be 16-bit-aligned. r=jrmuizel +--- + gfx/thebes/gfxFontUtils.cpp | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +diff --git gfx/thebes/gfxFontUtils.cpp gfx/thebes/gfxFontUtils.cpp +index 526e17d..cb505e8 100644 +--- gfx/thebes/gfxFontUtils.cpp ++++ gfx/thebes/gfxFontUtils.cpp +@@ -918,16 +918,18 @@ IsValidSFNTVersion(uint32_t version) + version == TRUETYPE_TAG('t','r','u','e'); + } + +-// copy and swap UTF-16 values, assume no surrogate pairs, can be in place ++// Copy and swap UTF-16 values, assume no surrogate pairs, can be in place. ++// aInBuf and aOutBuf are NOT necessarily 16-bit-aligned, so we should avoid ++// accessing them directly as uint16_t* values. ++// aLen is count of UTF-16 values, so the byte buffers are twice that. + static void +-CopySwapUTF16(const uint16_t *aInBuf, uint16_t *aOutBuf, uint32_t aLen) ++CopySwapUTF16(const char* aInBuf, char* aOutBuf, uint32_t aLen) + { +- const uint16_t *end = aInBuf + aLen; ++ const char* end = aInBuf + aLen * 2; + while (aInBuf < end) { +- uint16_t value = *aInBuf; +- *aOutBuf = (value >> 8) | (value & 0xff) << 8; +- aOutBuf++; +- aInBuf++; ++ uint8_t b0 = *aInBuf++; ++ *aOutBuf++ = *aInBuf++; ++ *aOutBuf++ = b0; + } + } + +@@ -1446,13 +1448,13 @@ gfxFontUtils::DecodeFontName(const char *aNameData, int32_t aByteLen, + if (csName[0] == 0) { + // empty charset name: data is utf16be, no need to instantiate a converter + uint32_t strLen = aByteLen / 2; +-#ifdef IS_LITTLE_ENDIAN + aName.SetLength(strLen); +- CopySwapUTF16(reinterpret_cast<const uint16_t*>(aNameData), +- reinterpret_cast<uint16_t*>(aName.BeginWriting()), strLen); ++#ifdef IS_LITTLE_ENDIAN ++ CopySwapUTF16(aNameData, reinterpret_cast<char*>(aName.BeginWriting()), ++ strLen); + #else +- aName.Assign(reinterpret_cast<const char16_t*>(aNameData), strLen); +-#endif ++ memcpy(aName.BeginWriting(), aNameData, strLen * 2); ++#endif + return true; + } + Modified: branches/2016Q4/www/seamonkey/Makefile ============================================================================== --- branches/2016Q4/www/seamonkey/Makefile Tue Nov 8 13:01:42 2016 (r425737) +++ branches/2016Q4/www/seamonkey/Makefile Tue Nov 8 13:11:31 2016 (r425738) @@ -4,6 +4,7 @@ PORTNAME= seamonkey DISTVERSION= 2.40 MOZILLA_VER= 43 # above + 3 +PORTREVISION= 1 CATEGORIES?= www mail news editors irc ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source Copied: branches/2016Q4/www/seamonkey/files/patch-bug757366 (from r425733, head/www/seamonkey/files/patch-bug757366) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q4/www/seamonkey/files/patch-bug757366 Tue Nov 8 13:11:31 2016 (r425738, copy of r425733, head/www/seamonkey/files/patch-bug757366) @@ -0,0 +1,58 @@ +commit 2a3be4b384b9 +Author: Jonathan Kew <jkew@mozilla.com> +Date: Mon Sep 26 18:05:14 2016 +0100 + + Bug 757366 - Don't cast pointers to 'name'-table data to uint16_t*, as they may not be 16-bit-aligned. r=jrmuizel +--- + gfx/thebes/gfxFontUtils.cpp | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +diff --git gfx/thebes/gfxFontUtils.cpp gfx/thebes/gfxFontUtils.cpp +index 526e17d..cb505e8 100644 +--- mozilla/gfx/thebes/gfxFontUtils.cpp ++++ mozilla/gfx/thebes/gfxFontUtils.cpp +@@ -918,16 +918,18 @@ IsValidSFNTVersion(uint32_t version) + version == TRUETYPE_TAG('t','r','u','e'); + } + +-// copy and swap UTF-16 values, assume no surrogate pairs, can be in place ++// Copy and swap UTF-16 values, assume no surrogate pairs, can be in place. ++// aInBuf and aOutBuf are NOT necessarily 16-bit-aligned, so we should avoid ++// accessing them directly as uint16_t* values. ++// aLen is count of UTF-16 values, so the byte buffers are twice that. + static void +-CopySwapUTF16(const uint16_t *aInBuf, uint16_t *aOutBuf, uint32_t aLen) ++CopySwapUTF16(const char* aInBuf, char* aOutBuf, uint32_t aLen) + { +- const uint16_t *end = aInBuf + aLen; ++ const char* end = aInBuf + aLen * 2; + while (aInBuf < end) { +- uint16_t value = *aInBuf; +- *aOutBuf = (value >> 8) | (value & 0xff) << 8; +- aOutBuf++; +- aInBuf++; ++ uint8_t b0 = *aInBuf++; ++ *aOutBuf++ = *aInBuf++; ++ *aOutBuf++ = b0; + } + } + +@@ -1446,13 +1448,13 @@ gfxFontUtils::DecodeFontName(const char *aNameData, int32_t aByteLen, + if (csName[0] == 0) { + // empty charset name: data is utf16be, no need to instantiate a converter + uint32_t strLen = aByteLen / 2; +-#ifdef IS_LITTLE_ENDIAN + aName.SetLength(strLen); +- CopySwapUTF16(reinterpret_cast<const uint16_t*>(aNameData), +- reinterpret_cast<uint16_t*>(aName.BeginWriting()), strLen); ++#ifdef IS_LITTLE_ENDIAN ++ CopySwapUTF16(aNameData, reinterpret_cast<char*>(aName.BeginWriting()), ++ strLen); + #else +- aName.Assign(reinterpret_cast<const char16_t*>(aNameData), strLen); +-#endif ++ memcpy(aName.BeginWriting(), aNameData, strLen * 2); ++#endif + return true; + } +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611081311.uA8DBV6u011107>