@@ -849,6 +849,8 @@ int izamax( int n, doublecomplex *x, int incx)
849
849
float snrm2 ( int n , float * x , int incx )
850
850
{
851
851
#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).
852
854
if (n < 1 || incx < 1 ) {
853
855
return 0 ;
854
856
}
@@ -861,6 +863,8 @@ float snrm2( int n, float *x, int incx)
861
863
double dnrm2 ( int n , double * x , int incx )
862
864
{
863
865
#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).
864
868
if (n < 1 || incx < 1 ) {
865
869
return 0 ;
866
870
}
@@ -873,6 +877,8 @@ double dnrm2( int n, double *x, int incx)
873
877
float scnrm2 ( int n , complex * x , int incx )
874
878
{
875
879
#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).
876
882
if (n < 1 || incx < 1 ) {
877
883
return 0 ;
878
884
}
@@ -885,6 +891,8 @@ float scnrm2( int n, complex *x, int incx)
885
891
double dznrm2 ( int n , doublecomplex * x , int incx )
886
892
{
887
893
#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).
888
896
if (n < 1 || incx < 1 ) {
889
897
return 0 ;
890
898
}
0 commit comments