Jeroen Demeyer on Sun, 09 Feb 2014 14:48:41 +0100

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Infinite loop in initprimes0()

Dear pari-dev,

When calling initprimes0(), an infinite loop is possible.

The culprit is

    /* recursive call (remember that maxnum > maxpr) */
    (void) initprimes0(maxss(rootnum, maxpr), &psize, &last, p1);

Despite what the comment says, there is no guarantee at all that
maxnum > maxpr in recursive calls.

I propose fixing this line to

    (void) initprimes0(rootnum, &psize, &last, p1);