Closed H-M-H closed 1 year ago
The gsl docs state:
These functions compute arrays of Legendre polynomials P_l(x) and derivatives dP_l(x)/dx for l = 0, \dots, lmax and |x| \le 1.
That is the parameter l is not the size of the array for the results. Thus the following is wrong: https://github.com/GuillaumeGomez/rust-GSL/blob/c21148fc63946dfa8a19e9894d830fd6de28ce33/src/legendre.rs#L75
l
Like that gsl tries to write to the address after the last array element resulting in undefined behavior.
Indeed, thanks!
The gsl docs state:
That is the parameter
l
is not the size of the array for the results. Thus the following is wrong: https://github.com/GuillaumeGomez/rust-GSL/blob/c21148fc63946dfa8a19e9894d830fd6de28ce33/src/legendre.rs#L75Like that gsl tries to write to the address after the last array element resulting in undefined behavior.