Correct assert.

This commit is contained in:
jzmaddock
2025-05-22 19:42:08 +01:00
parent a0fbb70a56
commit c129757f40

View File

@@ -398,6 +398,8 @@ inline BOOST_MP_CXX14_CONSTEXPR void left_shift_generic(Int& result, double_limb
{
const limb_type offset = static_cast<limb_type>(s / Int::limb_bits);
const limb_type shift = static_cast<limb_type>(s % Int::limb_bits);
typename Int::limb_pointer pr = result.limbs();
BOOST_ASSERT(shift < sizeof(pr[0]) * CHAR_BIT);
std::size_t ors = result.size();
@@ -410,8 +412,6 @@ inline BOOST_MP_CXX14_CONSTEXPR void left_shift_generic(Int& result, double_limb
result.resize(rs, rs);
bool truncated = result.size() != rs;
typename Int::limb_pointer pr = result.limbs();
if (offset > rs)
{
// The result is shifted past the end of the result: