Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUG: fix segfault in fftpack on OS X >=10.7 when compiling with llvm-…

…gcc.

See #1737.  Thanks to Alex Leach for help in debugging this issue.
  • Loading branch information...
commit 61fbbb64c781d39b7f4d11602491668e13e1a90b 1 parent d642f47
@rgommers rgommers authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 scipy/fftpack/src/zfft.c
View
10 scipy/fftpack/src/zfft.c
@@ -57,8 +57,9 @@ void zfft(complex_double * inout, int n, int direction, int howmany,
if (normalize) {
ptr = inout;
for (i = n * howmany - 1; i >= 0; --i) {
- *((double *) (ptr)) /= n;
- *((double *) (ptr++) + 1) /= n;
+ ptr->r /= n;
+ ptr->i /= n;
+ ptr++;
}
}
}
@@ -92,8 +93,9 @@ void cfft(complex_float * inout, int n, int direction, int howmany,
if (normalize) {
ptr = inout;
for (i = n * howmany - 1; i >= 0; --i) {
- *((float *) (ptr)) /= n;
- *((float *) (ptr++) + 1) /= n;
+ ptr->r /= n;
+ ptr->i /= n;
+ ptr++;
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.