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


test/bntest.c:1263:10: Call
1261.           goto err;
1262.   
1263.       if (!TEST_true(BN_div(ret, ret2, a, b, ctx))
                 ^
1264.               || !equalBN("A / B", quotient, ret)
1265.               || !equalBN("A % B", remainder, ret2)

crypto/bn/bn_div.c:137:1: Parameter `*dv->d`
  135.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
  136.    */
  137. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
  138.              BN_CTX *ctx)
  139.   {

test/bntest.c:1275:14: Call
1273.        * small enough.
1274.        */
1275.       b_word = BN_get_word(b);
                     ^
1276.       if (!BN_is_negative(b) && b_word != (BN_ULONG)-1) {
1277.           BN_ULONG remainder_word = BN_get_word(remainder);

crypto/bn/bn_lib.c:350:9: Assignment
  348.   {
  349.       if (a->top > 1)
  350.           return BN_MASK2;
                 ^
  351.       else if (a->top == 1)
  352.           return a->d[0];

test/bntest.c:1275:5: Assignment
1273.        * small enough.
1274.        */
1275.       b_word = BN_get_word(b);
            ^
1276.       if (!BN_is_negative(b) && b_word != (BN_ULONG)-1) {
1277.           BN_ULONG remainder_word = BN_get_word(remainder);

test/bntest.c:1282:20: Call
1280.           if (!TEST_ptr(BN_copy(ret, a)))
1281.               goto err;
1282.           ret_word = BN_div_word(ret, b_word);
                           ^
1283.           if (ret_word != remainder_word) {
1284.   #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:89:1: <RHS trace>
87.   }
88.   
89. > int BN_num_bits_word(BN_ULONG l)
90.   {
91.       BN_ULONG x, mask;

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

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

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