From 3a1e427b0c2edbd226172ab3f16bf8191b68a831 Mon Sep 17 00:00:00 2001 From: Yourself Date: Sun, 7 Nov 2021 18:22:40 -0700 Subject: [PATCH] fix infinite recursion in FindFirstBit64 --- src/core/bitmath_func.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/bitmath_func.cpp b/src/core/bitmath_func.cpp index ee62410291..82375fe500 100644 --- a/src/core/bitmath_func.cpp +++ b/src/core/bitmath_func.cpp @@ -45,8 +45,8 @@ uint8 FindFirstBit32(uint32 x) uint8 FindFirstBit64(uint64 x) { if (x == 0) return 0; - if ((x & 0x00000000ffffffffULL) != 0) return FindFirstBit(x); - return FindFirstBit(x >> 32) + 32; + if ((x & 0x00000000ffffffffULL) != 0) return FindFirstBit(static_cast(x)); + return FindFirstBit(static_cast(x >> 32)) + 32; } #endif