The internal uint class had a bug introduced recently when optimizing
the shift routines. When calculating the value of a block, it would
shift an adjacent block by 64 - the shift amount. If the shift amount
was 0, this would be a shift of 64, which is undefined for a 64 bit
integer. This patch fixes this by adding a conditional to catch this
case.
Details
Details
- Reviewers
lntue - Commits
- rGc4b7e8a035d5: [libc] fix shifting exact multiples of 64 in uint
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/src/__support/UInt.h | ||
---|---|---|
378 | Can you change it similar to the fix for shift right in https://reviews.llvm.org/D139566? I.e., move the check for shift == 0 or shift > 0 outside of the loop? | |
434 | This is not needed as shift is guaranteed to be positive in line 426. This was actually fixed in https://reviews.llvm.org/D139566 |
Comment Actions
move check for shift of 0 outside of loop for shift_left
remove redundant check in shift right
Can you change it similar to the fix for shift right in https://reviews.llvm.org/D139566? I.e., move the check for shift == 0 or shift > 0 outside of the loop?