Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/19792 )
Change subject: IMPALA-12086: Fix BitUtil::CountLeadingZeros for zero ...................................................................... IMPALA-12086: Fix BitUtil::CountLeadingZeros for zero BitUtil::CountLeadingZeros() uses _builtin_clz() and _builtin_clzll() to return the number of leading zeros in a number. Calling these functions with 0 is undefined. This change introduces a check in CountLeadingZeros() to only call these functions if the argument is non-zero. Also makes CountLeadingZeros() constexpr and restricts it to type sizes that can actually be handled by the function. Testing: - Added a test for CountLeadingZeros() in bit-util-test.cc Change-Id: I0ae3d84c5c25871388155747f91c51162c1a0590 Reviewed-on: http://gerrit.cloudera.org:8080/19792 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- M be/src/util/arithmetic-util.h M be/src/util/bit-util-test.cc M be/src/util/bit-util.h 3 files changed, 53 insertions(+), 2 deletions(-) Approvals: Impala Public Jenkins: Looks good to me, approved; Verified -- To view, visit http://gerrit.cloudera.org:8080/19792 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0ae3d84c5c25871388155747f91c51162c1a0590 Gerrit-Change-Number: 19792 Gerrit-PatchSet: 4 Gerrit-Owner: Daniel Becker <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Daniel Becker <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Noemi Pap-Takacs <[email protected]> Gerrit-Reviewer: Peter Rozsa <[email protected]>
