| ... | @@ -1683,10 +1683,20 @@ void bigint_incr(BigInt *x) { | ... | @@ -1683,10 +1683,20 @@ void bigint_incr(BigInt *x) { |
| 1683 | bigint_init_unsigned(x, 1); | 1683 | bigint_init_unsigned(x, 1); |
| 1684 | return; | 1684 | return; |
| 1685 | } | 1685 | } |
| 1686 | | 1686 | |
| 1687 | if (x->digit_count == 1 && x->data.digit != UINT64_MAX) { | 1687 | if (x->digit_count == 1) { |
| 1688 | x->data.digit += 1; | 1688 | if (x->is_negative) { |
| 1689 | return; | 1689 | if (x->data.digit != 0) { |
| | 1690 | x->data.digit -= 1; |
| | 1691 | } |
| | 1692 | return; |
| | 1693 | } |
| | 1694 | else { |
| | 1695 | if (x->data.digit != UINT64_MAX) { |
| | 1696 | x->data.digit += 1; |
| | 1697 | } |
| | 1698 | return; |
| | 1699 | } |
| 1690 | } | 1700 | } |
| 1691 | | 1701 | |
| 1692 | BigInt copy; | 1702 | BigInt copy; |