[libc] Fix undefined behavior in UInt<>::shift_right.
authorTue Ly <lntue@google.com>
Wed, 7 Dec 2022 19:24:46 +0000 (14:24 -0500)
committerTue Ly <lntue@google.com>
Wed, 7 Dec 2022 23:38:08 +0000 (18:38 -0500)
commit360b41c7ba7f09e375e27b674ba44e96f3d1f055
tree2ff0a1a11c130eb8fe274bf939c7c9f373d8871a
parent3738ce05a70cf97fc73a07b158a1726f61aed28b
[libc] Fix undefined behavior in UInt<>::shift_right.

Fix undefined behavior of left-shifting uint64_t by 64 in
`UInt<>::shift_right` implementation.

Reviewed By: michaelrj, sivachandra

Differential Revision: https://reviews.llvm.org/D139566
libc/src/__support/UInt.h
libc/test/src/__support/uint_test.cpp