Fix Numpy 1.20.0 by initializing PyArray_Descr portably
Merged
requested to merge leo-singer/lalsuite:numpy-1.20.0-compatible-dtype-initialization into master
Compare changes
- Leo Pound Singer authored
According to [the Numpy documentation](https://numpy.org/doc/stable/reference/c-api/types-and-structures.html#c.PyArray_Descr): > To ensure compatibility: > > - Never declare a non-pointer instance of the struct > - Never perform pointer arithmatic > - Never use `sizof(PyArray_Descr)` The SWIG bindings broke the first of these rules. Improper order of initialization led to a null pointer that was causing a segfault. Fixes #414.
+ 9
− 23
@@ -655,24 +655,6 @@ SWIGINTERN bool swiglal_release_parent(void *ptr) {
@@ -683,22 +665,26 @@ SWIGINTERN bool swiglal_release_parent(void *ptr) {