Skip to content

Commit

Permalink
protect find_msb from passing 0
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMlashkin committed Sep 25, 2024
1 parent 82a0813 commit 2d082c1
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ namespace boost {
return i * cpp_int_modular_backend<Bits>::limb_bits +
boost::multiprecision::detail::find_msb(a.limbs()[i]);
}
if (a.limbs()[0] == 0) // TODO here should assert/throw
return 1024; // Some big number to indicate that there is no bit 1
return boost::multiprecision::detail::find_msb(a.limbs()[0]);
}

Expand Down

0 comments on commit 2d082c1

Please sign in to comment.