Commit 3241b4fe authored by Simon McVittie's avatar Simon McVittie

tests: Generate random values in unsigned integer space

When we're doing bitwise operations, addition with wraparound and
large left-shifts, it seems safer to use unsigned integers, where
the effect of overflow is well-defined (it wraps around). Signed
integer overflow is undefined behaviour, so compilers are free to
optimize by assuming that it cannot happen.

Detected by the undefined behaviour sanitizer (UBSan).
Signed-off-by: Simon McVittie's avatarSimon McVittie <>
parent 000ef530
This diff is collapsed.
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