From 7c070892e22d988e663e9b2ec3ba9d60c47696e8 Mon Sep 17 00:00:00 2001 From: Mark Wiebe Date: Mon, 5 Mar 2012 19:52:04 -0800 Subject: [PATCH] BUG: Fix alignment bug in data copy routine Thanks to Matthew Brett for tracking this down on a 64-bit SPARC running Debian. --- numpy/core/src/multiarray/dtype_transfer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numpy/core/src/multiarray/dtype_transfer.c b/numpy/core/src/multiarray/dtype_transfer.c index 47c487338dd8..46acd046fc4d 100644 --- a/numpy/core/src/multiarray/dtype_transfer.c +++ b/numpy/core/src/multiarray/dtype_transfer.c @@ -3846,9 +3846,9 @@ PyArray_CastRawArrays(npy_intp count, } /* Check data alignment */ - aligned = (((npy_intp)src_dtype | src_stride) & + aligned = (((npy_intp)src | src_stride) & (src_dtype->alignment - 1)) == 0 && - (((npy_intp)dst_dtype | dst_stride) & + (((npy_intp)dst | dst_stride) & (dst_dtype->alignment - 1)) == 0; /* Get the function to do the casting */