Bug in Test Routines

Torbjorn Granlund tege at swox.com
Tue Jun 13 20:40:04 CEST 2006

Brian Gladman <brg at gladman.plus.com> writes:

  I think there is a bug in the test file refmpn.c, in subroutine
  sb_divrem_mn (at line 1674):
   ASSERT (refmpn_add_n(np+i, np+i, dp, dsize) != 0);
  If assertions are turned off, this line will be empty and the necessary
  addition will then be absent.
   n0 = refmpn_add_n(np+i, np+i, dp, dsize);
   ASSERT (n0 != 0);
  is needed instead.
Thanks for spotting this.

The reason this hasn't been  triggered is that the likelyhood
of the problematic outcome is extremely slim.

I replaced the ASSERT by ASSERT_CARRY.


More information about the gmp-bugs mailing list