summaryrefslogtreecommitdiff
path: root/numpy/core/src/arrayobject.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2007-05-22 22:36:10 +0000
committerTravis Oliphant <oliphant@enthought.com>2007-05-22 22:36:10 +0000
commit4cfa7705d3a05b75d5c7031ad958d1adf818fe7e (patch)
treeb1d7906eb7ff42ecba5fd92790f1a9ef291f298e /numpy/core/src/arrayobject.c
parent4de81d32d97a2efb1023ca0c19e36990f1ba64a4 (diff)
downloadnumpy-4cfa7705d3a05b75d5c7031ad958d1adf818fe7e.tar.gz
Add a few more checks to make sure that numpy unicode scalars report correctly on narrow builds. Fix a long-standing seg-fault that arose when calling u.imag on an object with numpy.unicode_ type.
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r--numpy/core/src/arrayobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index b5b39caad..e02cff92e 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -1378,7 +1378,7 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base)
byte_swap_vector(destptr, length, 4);
#else
/* need aligned data buffer */
- if (!PyArray_ISBEHAVED(base)) {
+ if ((((intp)data) % descr->alignment) != 0) {
buffer = _pya_malloc(itemsize);
if (buffer == NULL)
return PyErr_NoMemory();