SIGN IN SIGN UP

qsort: fix shift UB in shl and shr

if shl() or shr() are called with n==8*sizeof(size_t), n is adjusted
to 0. the shift by (sizeof(size_t) * 8 - n) that then follows will
consequently shift by the width of size_t, which is UB and in practice
produces an incorrect result.

return early in this case. the bitvector p was already shifted by the
required amount.
L
Luca Kellermann committed
5122f9f3c99fee366167c5de98b31546312921ab
Parent: b3291b9
Committed by Rich Felker <dalias@aerifal.cx> on 4/10/2026, 2:31:17 PM