diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-02-01 02:38:56 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-02-01 02:38:56 (GMT) |
commit | a17b6bb5fe6a3e12ef359cc4c214cf7a7785bd88 (patch) | |
tree | ff7b8bf0d6d4391a34e5e8d8eb5acee153fd72b5 /Python/pyhash.c | |
parent | 606ab031c1e72af498d9417e4724ebf28539dafd (diff) | |
download | cpython-a17b6bb5fe6a3e12ef359cc4c214cf7a7785bd88.zip cpython-a17b6bb5fe6a3e12ef359cc4c214cf7a7785bd88.tar.gz cpython-a17b6bb5fe6a3e12ef359cc4c214cf7a7785bd88.tar.bz2 |
Issue #20162: Fix an alignment issue in the siphash24() hash function which
caused a crash on PowerPC 64-bit (ppc64).
Diffstat (limited to 'Python/pyhash.c')
-rw-r--r-- | Python/pyhash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pyhash.c b/Python/pyhash.c index 19aeeb7..97cb547 100644 --- a/Python/pyhash.c +++ b/Python/pyhash.c @@ -399,7 +399,7 @@ siphash24(const void *src, Py_ssize_t src_sz) { case 7: pt[6] = m[6]; case 6: pt[5] = m[5]; case 5: pt[4] = m[4]; - case 4: *((PY_UINT32_T*)&pt[0]) = *((PY_UINT32_T*)&m[0]); break; + case 4: Py_MEMCPY(pt, m, sizeof(PY_UINT32_T)); break; case 3: pt[2] = m[2]; case 2: pt[1] = m[1]; case 1: pt[0] = m[0]; |