@@ -849,6 +849,8 @@ int izamax( int n, doublecomplex *x, int incx)
849849float snrm2 ( int n , float * x , int incx )
850850{
851851#ifdef __APPLE__
852+ //On OSX passing negative values for incx can lead to a
853+ //a crash, so we catch it here (cf. Github issue #37).
852854 if (n < 1 || incx < 1 ) {
853855 return 0 ;
854856 }
@@ -861,6 +863,8 @@ float snrm2( int n, float *x, int incx)
861863double dnrm2 ( int n , double * x , int incx )
862864{
863865#ifdef __APPLE__
866+ //On OSX passing negative values for incx can lead to a
867+ //a crash, so we catch it here (cf. Github issue #37).
864868 if (n < 1 || incx < 1 ) {
865869 return 0 ;
866870 }
@@ -873,6 +877,8 @@ double dnrm2( int n, double *x, int incx)
873877float scnrm2 ( int n , complex * x , int incx )
874878{
875879#ifdef __APPLE__
880+ //On OSX passing negative values for incx can lead to a
881+ //a crash, so we catch it here (cf. Github issue #37).
876882 if (n < 1 || incx < 1 ) {
877883 return 0 ;
878884 }
@@ -885,6 +891,8 @@ float scnrm2( int n, complex *x, int incx)
885891double dznrm2 ( int n , doublecomplex * x , int incx )
886892{
887893#ifdef __APPLE__
894+ //On OSX passing negative values for incx can lead to a
895+ //a crash, so we catch it here (cf. Github issue #37).
888896 if (n < 1 || incx < 1 ) {
889897 return 0 ;
890898 }
0 commit comments