danaj / Math-Prime-Util-GMP

Perl prime number module using XS/GMP
Other
17 stars 9 forks source link

Segmentation fault for divisors(1) #8

Closed trizen closed 7 years ago

trizen commented 7 years ago

Hi,

There seems to be a minor issue in Math::Prime::Util::GMP::divisors(n) when n=1:

use 5.014;
use Math::Prime::Util::GMP qw(divisors);
say for divisors(1);

Output:

[1]    17417 segmentation fault (core dumped)  perl x.pl
danaj commented 7 years ago

Segmentation faults are not good at all. One line fix in b02d89a plus a test.

trizen commented 7 years ago

Fix confirmed. Thank you for taking the time in fixing it. :+1: