summaryrefslogtreecommitdiff
path: root/debian/patches/pyhash.diff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2019-12-01 17:44:24 +0300
committerIgor Pashev <pashev.igor@gmail.com>2019-12-01 17:44:24 +0300
commitc089c4500b0b78acf03ee5405ad250a84b0dfa66 (patch)
tree23870848d194569aff6e0e4e41bc7907960b1af1 /debian/patches/pyhash.diff
parent377002e7300431b68f3548d9fd2c7f99cf883939 (diff)
downloadpython3.7-debian.tar.gz
Import python3.7 (3.7.5-2)debian/3.7.5-2debian
Diffstat (limited to 'debian/patches/pyhash.diff')
-rw-r--r--debian/patches/pyhash.diff67
1 files changed, 0 insertions, 67 deletions
diff --git a/debian/patches/pyhash.diff b/debian/patches/pyhash.diff
deleted file mode 100644
index f8ecfda..0000000
--- a/debian/patches/pyhash.diff
+++ /dev/null
@@ -1,67 +0,0 @@
-Index: b/Python/pyhash.c
-===================================================================
---- a/Python/pyhash.c
-+++ b/Python/pyhash.c
-@@ -328,13 +328,14 @@ static PyHash_FuncDef PyHash_Func = {fnv
- * the hash values' least significant bits.
- */
- #if PY_LITTLE_ENDIAN
--# define _le64toh(x) ((uint64_t)(x))
-+# define _le64toh(v, x) memcpy(&(v), &(x), sizeof(v))
- #elif defined(__APPLE__)
--# define _le64toh(x) OSSwapLittleToHostInt64(x)
-+# define _le64toh(v, x) v = OSSwapLittleToHostInt64(x)
- #elif defined(HAVE_LETOH64)
--# define _le64toh(x) le64toh(x)
-+# define _le64toh(v, x) v = le64toh(x)
- #else
--# define _le64toh(x) (((uint64_t)(x) << 56) | \
-+# define _le64toh(v, x) v = \
-+ (((uint64_t)(x) << 56) | \
- (((uint64_t)(x) << 40) & 0xff000000000000ULL) | \
- (((uint64_t)(x) << 24) & 0xff0000000000ULL) | \
- (((uint64_t)(x) << 8) & 0xff00000000ULL) | \
-@@ -366,22 +367,24 @@ static PyHash_FuncDef PyHash_Func = {fnv
-
- static Py_hash_t
- siphash24(const void *src, Py_ssize_t src_sz) {
-- uint64_t k0 = _le64toh(_Py_HashSecret.siphash.k0);
-- uint64_t k1 = _le64toh(_Py_HashSecret.siphash.k1);
-+ uint64_t k0, k1, v0, v1, v2, v3;
- uint64_t b = (uint64_t)src_sz << 56;
- const uint64_t *in = (uint64_t*)src;
-
-- uint64_t v0 = k0 ^ 0x736f6d6570736575ULL;
-- uint64_t v1 = k1 ^ 0x646f72616e646f6dULL;
-- uint64_t v2 = k0 ^ 0x6c7967656e657261ULL;
-- uint64_t v3 = k1 ^ 0x7465646279746573ULL;
--
-- uint64_t t;
-+ uint64_t t, t2;
- uint8_t *pt;
- uint8_t *m;
-
-+ _le64toh(k0, _Py_HashSecret.siphash.k0);
-+ _le64toh(k1, _Py_HashSecret.siphash.k1);
-+ v0 = k0 ^ 0x736f6d6570736575ULL;
-+ v1 = k1 ^ 0x646f72616e646f6dULL;
-+ v2 = k0 ^ 0x6c7967656e657261ULL;
-+ v3 = k1 ^ 0x7465646279746573ULL;
-+
- while (src_sz >= 8) {
-- uint64_t mi = _le64toh(*in);
-+ uint64_t mi;
-+ _le64toh(mi, *in);
- in += 1;
- src_sz -= 8;
- v3 ^= mi;
-@@ -401,7 +404,8 @@ siphash24(const void *src, Py_ssize_t sr
- case 2: pt[1] = m[1]; /* fall through */
- case 1: pt[0] = m[0]; /* fall through */
- }
-- b |= _le64toh(t);
-+ _le64toh(t2, t);
-+ b |= t2;
-
- v3 ^= b;
- DOUBLE_ROUND(v0,v1,v2,v3);