Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gutil] fix ASAN warning in CountOnes()
Running various tests on aarch64 (Graviton3) under ASAN produced warnings like below: src/kudu/gutil/bits.h:19:42: runtime error: unsigned integer overflow: 134678536 * 16843009 cannot be represented in type 'unsigned int' #0 0xffffa1ebd8d4 in Bits::CountOnes(unsigned int) src/kudu/gutil/bits.h:19:42 #1 0xffffa1ebd830 in Bits::CountOnes64(unsigned long) src/kudu/gutil/bits.h:30:12 #2 0xffffa1ebd7f8 in Bits::CountOnes64withPopcount(unsigned long) src/kudu/gutil/bits.h:43:12 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/kudu/gutil/bits.h:19:42 This patch addresses the issue. Change-Id: I47bff62676ee57706d6b5ef841e3891bba5a62fa Reviewed-on: http://gerrit.cloudera.org:8080/20558 Reviewed-by: Marton Greber <[email protected]> Tested-by: Alexey Serbin <[email protected]> Reviewed-by: Abhishek Chennaka <[email protected]>
- Loading branch information