Commit 853dee85 authored by Eugene Kosov's avatar Eugene Kosov Committed by Sergey Vojtovich

MDEV-17358 my_reverse_bits() is incorrect due to UB

my_reverse_bits(): add a cast to fix a bit shift
parent bebe24b0
......@@ -115,10 +115,10 @@ static inline uint32 my_clear_highest_bit(uint32 v)
static inline uint32 my_reverse_bits(uint32 key)
{
return
(_my_bits_reverse_table[ key & 255] << 24) |
(_my_bits_reverse_table[(key>> 8) & 255] << 16) |
(_my_bits_reverse_table[(key>>16) & 255] << 8) |
_my_bits_reverse_table[(key>>24) ];
((uint32)_my_bits_reverse_table[ key & 255] << 24) |
((uint32)_my_bits_reverse_table[(key>> 8) & 255] << 16) |
((uint32)_my_bits_reverse_table[(key>>16) & 255] << 8) |
(uint32)_my_bits_reverse_table[(key>>24) ];
}
C_MODE_END
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment