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


test/bntest.c:1347:10: Call
1345.           goto err;
1346.   
1347.       if (!TEST_true(BN_div(ret, ret2, a, b, ctx))
                 ^
1348.               || !equalBN("A / B", quotient, ret)
1349.               || !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:1359:14: Call
1357.        * small enough.
1358.        */
1359.       b_word = BN_get_word(b);
                     ^
1360.       if (!BN_is_negative(b) && b_word != (BN_ULONG)-1) {
1361.           BN_ULONG remainder_word = BN_get_word(remainder);

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

test/bntest.c:1359:5: Assignment
1357.        * small enough.
1358.        */
1359.       b_word = BN_get_word(b);
            ^
1360.       if (!BN_is_negative(b) && b_word != (BN_ULONG)-1) {
1361.           BN_ULONG remainder_word = BN_get_word(remainder);

test/bntest.c:1366:20: Call
1364.           if (!TEST_ptr(BN_copy(ret, a)))
1365.               goto err;
1366.           ret_word = BN_div_word(ret, b_word);
                           ^
1367.           if (ret_word != remainder_word) {
1368.   #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;
