[libc] [llvm] [libc][NFC] Remove __support/bit.h and use __support/CPP/bit.h instead (PR #73939)
Guillaume Chatelet via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 1 01:29:21 PST 2023
================
@@ -152,9 +152,9 @@ class HashState {
}
}
LIBC_INLINE uint64_t finish() {
- uint64_t rot = buffer & 63;
+ int rot = buffer & 63;
----------------
gchatelet wrote:
I think this doesn't work. I believe we're in [this case](https://en.cppreference.com/w/c/language/conversion#:~:text=otherwise%2C%20if%20the%20target%20type%20is%20signed%2C%20the%20behavior%20is%20implementation%2Ddefined%20(which%20may%20include%20raising%20a%20signal)) : _Integer conversions : if the target type is signed, the behavior is implementation-defined (which may include raising a signal)_.
I changed the code to fall in [this case](https://en.cppreference.com/w/c/language/conversion#:~:text=if%20the%20target%20type%20can%20represent%20the%20value%2C%20the%20value%20is%20unchanged) : _if the target type can represent the value, the value is unchanged_.
https://github.com/llvm/llvm-project/pull/73939
More information about the llvm-commits
mailing list