19 Jan
2026
19 Jan
'26
10:44 p.m.
Alfred Agrell (@Alcaro) commented about dlls/ntdll/tests/rtl.c:
free( group_sid ); }
+static ULONG_PTR rotate_bits_right( ULONG_PTR v, ULONG count ) +{ + static const unsigned int bits = sizeof(v) * 8; + + count %= bits; + return (v >> count) | (v << (bits - count));
If count==0, bits-count = 64, and v<<64 is UB. (Or 32 on 32bit builds, but still UB.) Consider instead `return (v >> (count % bits)) | (v << ((bits - count) % bits));`. https://godbolt.org/z/9nWP6zK8P (Or stdc_rotate_right, except that one doesn't exist until C23.) Same for the rotate left function below, and the actual encode/decode pointer functions. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9926#note_127365