Skip to content

blas_stride has the wrong return type with HAVE_BLAS_ILP64 #17111

@eric-wieser

Description

@eric-wieser

The return type of blas_stride is int, but it contains a comparison to MAX_INT64:

static NPY_INLINE int
blas_stride(npy_intp stride, unsigned itemsize)
{
/*
* Should probably check pointer alignment also, but this may cause
* problems if we require complex to be 16 byte aligned.
*/
if (stride > 0 && npy_is_aligned((void *)stride, itemsize)) {
stride /= itemsize;
#ifndef HAVE_BLAS_ILP64
if (stride <= INT_MAX) {
#else
if (stride <= NPY_MAX_INT64) {
#endif
return stride;
}
}
return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions