test/bntest.c:1425: error: INTEGER_OVERFLOW_L2
  (0 - [0, 18446744073709551615]):unsigned64 by call to `BN_div_word`.
Showing all 16 steps of the trace


test/bntest.c:1409:17: Call
1407.               || !equalBN("A / B", quotient, ret)
1408.               || !equalBN("A % B", remainder, ret2)
1409.               || !TEST_true(BN_mul(ret, quotient, b, ctx))
                        ^
1410.               || !TEST_true(BN_add(ret, ret, remainder))
1411.               || !equalBN("Quotient * B + Remainder", a, ret))

crypto/bn/bn_mul.c:499:15: Call
  497.   int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
  498.   {
  499.       int ret = bn_mul_fixed_top(r, a, b, ctx);
                       ^
  500.   
  501.       bn_correct_top(r);

crypto/bn/bn_mul.c:507:1: Parameter `*a->d`
    505.   }
    506.   
    507. > int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
    508.   {
    509.       int ret = 0;

test/bntest.c:1410:17: Call
1408.               || !equalBN("A % B", remainder, ret2)
1409.               || !TEST_true(BN_mul(ret, quotient, b, ctx))
1410.               || !TEST_true(BN_add(ret, ret, remainder))
                        ^
1411.               || !equalBN("Quotient * B + Remainder", a, ret))
1412.           goto err;

crypto/bn/bn_add.c:14:1: Parameter `*a->d`
  12.   
  13.   /* signed add of b to a. */
  14. > int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
  15.   {
  16.       int ret, r_neg, cmp_res;

test/bntest.c:1418:14: Call
1416.        * small enough.
1417.        */
1418.       b_word = BN_get_word(b);
                     ^
1419.       if (!BN_is_negative(b) && b_word != (BN_ULONG)-1) {
1420.           BN_ULONG remainder_word = BN_get_word(remainder);

crypto/bn/bn_lib.c:354:9: Assignment
  352.   {
  353.       if (a->top > 1)
  354.           return BN_MASK2;
                 ^
  355.       else if (a->top == 1)
  356.           return a->d[0];

test/bntest.c:1418:5: Assignment
1416.        * small enough.
1417.        */
1418.       b_word = BN_get_word(b);
            ^
1419.       if (!BN_is_negative(b) && b_word != (BN_ULONG)-1) {
1420.           BN_ULONG remainder_word = BN_get_word(remainder);

test/bntest.c:1425:20: Call
1423.           if (!TEST_ptr(BN_copy(ret, a)))
1424.               goto err;
1425.           ret_word = BN_div_word(ret, b_word);
                           ^
1426.           if (ret_word != remainder_word) {
1427.   #ifdef BN_DEC_FMT1

crypto/bn/bn_word.c:61:1: Parameter `w`
  59.   }
  60.   
  61. > BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w)
  62.   {
  63.       BN_ULONG ret = 0;

crypto/bn/bn_word.c:67:5: Assignment
  65.   
  66.       bn_check_top(a);
  67.       w &= BN_MASK2;
            ^
  68.   
  69.       if (!w)

crypto/bn/bn_word.c:76:20: Call
  74.   
  75.       /* normalize input (so bn_div_words doesn't complain) */
  76.       j = BN_BITS2 - BN_num_bits_word(w);
                           ^
  77.       w <<= j;
  78.       if (!BN_lshift(a, a, j))

crypto/bn/bn_lib.c:90:1: <RHS trace>
88.   }
89.   
90. > int BN_num_bits_word(BN_ULONG l)
91.   {
92.       BN_ULONG x, mask;

crypto/bn/bn_lib.c:90:1: Parameter `l`
    88.   }
    89.   
    90. > int BN_num_bits_word(BN_ULONG l)
    91.   {
    92.       BN_ULONG x, mask;

crypto/bn/bn_lib.c:96:5: Assignment
    94.   
    95.   #if BN_BITS2 > 32
    96.       x = l >> 32;
              ^
    97.       mask = (0 - x) & BN_MASK2;
    98.       mask = (0 - (mask >> (BN_BITS2 - 1)));

crypto/bn/bn_lib.c:97:5: Binary operation: (0 - [0, 18446744073709551615]):unsigned64 by call to `BN_div_word` 
    95.   #if BN_BITS2 > 32
    96.       x = l >> 32;
    97.       mask = (0 - x) & BN_MASK2;
               ^
    98.       mask = (0 - (mask >> (BN_BITS2 - 1)));
    99.       bits += 32 & mask;
