public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
Date: Fri,  3 Sep 2021 18:18:18 +0000 (UTC)	[thread overview]
Message-ID: <1630693096.7336b4f587b29d26018d925ed58f5aef503af218.mgorny@gentoo> (raw)

commit:     7336b4f587b29d26018d925ed58f5aef503af218
Author:     Rolf Eike Beer <eike <AT> sf-mail <DOT> de>
AuthorDate: Fri Sep  3 13:15:19 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep  3 18:18:16 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7336b4f5

dev-python/cython: fix unaligned accesses in type conversions

Signed-off-by: Rolf Eike Beer <eike <AT> sf-mail.de>
Closes: https://github.com/gentoo/gentoo/pull/22204
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 ...hon-0.29.24.ebuild => cython-0.29.24-r1.ebuild} |  1 +
 .../files/cython-0.29.24-unaligned-format.patch    | 33 ++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/dev-python/cython/cython-0.29.24.ebuild b/dev-python/cython/cython-0.29.24-r1.ebuild
similarity index 97%
rename from dev-python/cython/cython-0.29.24.ebuild
rename to dev-python/cython/cython-0.29.24-r1.ebuild
index 0c107a31d2b..dced6974732 100644
--- a/dev-python/cython/cython-0.29.24.ebuild
+++ b/dev-python/cython/cython-0.29.24-r1.ebuild
@@ -31,6 +31,7 @@ BDEPEND="${RDEPEND}
 PATCHES=(
 	"${FILESDIR}/${PN}-0.29.22-spawn-multiprocessing.patch"
 	"${FILESDIR}/${PN}-0.29.23-test_exceptions-py310.patch"
+	"${FILESDIR}/${PN}-0.29.24-unaligned-format.patch"
 )
 
 SITEFILE=50cython-gentoo.el

diff --git a/dev-python/cython/files/cython-0.29.24-unaligned-format.patch b/dev-python/cython/files/cython-0.29.24-unaligned-format.patch
new file mode 100644
index 00000000000..955c32debb4
--- /dev/null
+++ b/dev-python/cython/files/cython-0.29.24-unaligned-format.patch
@@ -0,0 +1,33 @@
+From 2c08fd50d62e4255602ee3c0d41157df7608e773 Mon Sep 17 00:00:00 2001
+From: Stefan Behnel <stefan_ml@behnel.de>
+Date: Wed, 1 Sep 2021 00:09:02 +0200
+Subject: [PATCH] Avoid copying unaligned 16-bit values since some platforms
+ require them to be aligned. Use memcpy() instead to let the C compiler decide
+ how to do it.
+
+Closes https://github.com/cython/cython/issues/4343
+---
+ Cython/Utility/TypeConversion.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Cython/Utility/TypeConversion.c b/Cython/Utility/TypeConversion.c
+index 751d12b62a..3669bc9ec1 100644
+--- a/Cython/Utility/TypeConversion.c
++++ b/Cython/Utility/TypeConversion.c
+@@ -829,14 +829,14 @@ static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value, Py_ssize_t wid
+             digit_pos = abs((int)(remaining % (8*8)));
+             remaining = ({{TYPE}}) (remaining / (8*8));
+             dpos -= 2;
+-            *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_8)[digit_pos]; /* copy 2 digits at a time */
++            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); /* copy 2 digits at a time, unaligned */
+             last_one_off = (digit_pos < 8);
+             break;
+         case 'd':
+             digit_pos = abs((int)(remaining % (10*10)));
+             remaining = ({{TYPE}}) (remaining / (10*10));
+             dpos -= 2;
+-            *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_10)[digit_pos]; /* copy 2 digits at a time */
++            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); /* copy 2 digits at a time, unaligned */
+             last_one_off = (digit_pos < 10);
+             break;
+         case 'x':


             reply	other threads:[~2021-09-03 18:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03 18:18 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-10-02  4:22 [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/ Michał Górny
2023-09-12  7:05 Michał Górny
2023-07-28 11:07 Sam James
2023-07-17 17:53 Sam James
2023-06-15 18:26 Michał Górny
2023-03-24  5:12 Sam James
2021-05-15  0:36 Marek Szuba
2021-03-06  3:24 Sam James
2020-12-10 19:41 Sam James
2020-06-15 13:20 Michał Górny
2019-11-20  4:56 Patrick McLean
2019-07-04  3:27 Tim Harder
2016-03-24 11:16 Ian Delaney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1630693096.7336b4f587b29d26018d925ed58f5aef503af218.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox