Fix off-by-one in fallback MSB function

This commit is contained in:
Patrick Niklaus 2017-03-06 23:53:52 +00:00 committed by Patrick Niklaus
parent c29391636a
commit a92fa257af

View File

@ -22,7 +22,8 @@ template <typename T> std::size_t msb(T value)
value >>= 1u;
msb++;
}
return msb;
BOOST_ASSERT(msb > 0);
return msb-1;
}
#if (defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)) && __x86_64__