summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2015-02-01 18:19:49 (GMT)
committerStefan Krah <skrah@bytereef.org>2015-02-01 18:19:49 (GMT)
commit2e6658b4a7e68c256a1a55ba4757076d44a8c43c (patch)
treeb5bac2c6706d5b06c7e2faa795efbc3f352d5c67 /Objects/abstract.c
parent5b90f5de26fc6a659e8bb2224c31af89c0b71d0b (diff)
parent7213fcc27ec4ca06fbda4633aff95d8ca2701e43 (diff)
downloadcpython-2e6658b4a7e68c256a1a55ba4757076d44a8c43c.zip
cpython-2e6658b4a7e68c256a1a55ba4757076d44a8c43c.tar.gz
cpython-2e6658b4a7e68c256a1a55ba4757076d44a8c43c.tar.bz2
Merge from 3.4.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 92d1ac8..d7dde91 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -512,7 +512,7 @@ PyBuffer_FromContiguous(Py_buffer *view, void *buf, Py_ssize_t len, char fort)
/* Otherwise a more elaborate scheme is needed */
- /* XXX(nnorwitz): need to check for overflow! */
+ /* view->ndim <= 64 */
indices = (Py_ssize_t *)PyMem_Malloc(sizeof(Py_ssize_t)*(view->ndim));
if (indices == NULL) {
PyErr_NoMemory();
@@ -534,10 +534,10 @@ PyBuffer_FromContiguous(Py_buffer *view, void *buf, Py_ssize_t len, char fort)
*/
elements = len / view->itemsize;
while (elements--) {
- addone(view->ndim, indices, view->shape);
ptr = PyBuffer_GetPointer(view, indices);
memcpy(ptr, src, view->itemsize);
src += view->itemsize;
+ addone(view->ndim, indices, view->shape);
}
PyMem_Free(indices);