[*] 32BIT MAKING ME MALD (critical bitscan forward bug under 32bit targets)

This commit is contained in:
Reece Wilson 2022-08-12 23:13:30 +01:00
parent c43bf9e1cd
commit 85c85d1a1b

View File

@ -38,7 +38,7 @@ static auline bool AuBitScanForward(AuUInt8 &index, T value)
if constexpr (sizeof(T) == sizeof(AuUInt64)) if constexpr (sizeof(T) == sizeof(AuUInt64))
{ {
#if defined(AURORA_IS_32BIT) #if defined(AURORA_IS_32BIT)
if (!_BitScanForward(&ret, static_cast<AuUInt32>(value & 0xffffffff))) if (!(success = _BitScanForward(&ret, static_cast<AuUInt32>(value & 0xffffffff))))
{ {
if (!_BitScanForward(&ret, static_cast<AuUInt32>((value >> 32) & 0xffffffff))) if (!_BitScanForward(&ret, static_cast<AuUInt32>((value >> 32) & 0xffffffff)))
{ {