Skip to content

Commit

Permalink
Fix segfault in windows due to incorrect initialisation of Py_ssize_t…
Browse files Browse the repository at this point in the history
… array
  • Loading branch information
rosswhitfield committed Dec 10, 2019
1 parent 0afda6a commit 0bf851b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions javelin/modifier.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ cdef class BaseModifier:
cdef cnp.ndarray[Py_ssize_t, ndim=2] cells = np.zeros((number_of_cells, 4), dtype=np.intp)
self.cells = cells
cdef void initialize_sites(self, object sites):
"""Initialize the sites correctly as numpy int array"""
self.sites = np.atleast_1d(np.asarray(sites, dtype=int))
"""Initialize the sites correctly as numpy Py_ssize_t (np.intp) array"""
self.sites = np.atleast_1d(np.asarray(sites, dtype=np.intp))
@cython.initializedcheck(False)
@cython.boundscheck(False)
cpdef Py_ssize_t[:,:] get_random_cells(self, Py_ssize_t size_x, Py_ssize_t size_y, Py_ssize_t size_z) except *:
Expand Down

0 comments on commit 0bf851b

Please sign in to comment.