mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-06 10:32:58 +00:00
bit_util: bug: Infinite loop in HighestSetBit
This commit is contained in:
@@ -101,6 +101,9 @@ inline int HighestSetBit(T value) {
|
||||
template <typename T>
|
||||
inline size_t LowestSetBit(T value) {
|
||||
auto x = static_cast<std::make_unsigned_t<T>>(value);
|
||||
if (x == 0)
|
||||
return BitSize<T>();
|
||||
|
||||
size_t result = 0;
|
||||
while ((x & 1) == 0) {
|
||||
x >>= 1;
|
||||
|
||||
Reference in New Issue
Block a user