From 6e2dfa148c6ada3fb28d416814d9fb04539dd93f Mon Sep 17 00:00:00 2001 From: fenrir Date: Tue, 12 Nov 2024 23:42:53 +0900 Subject: [PATCH] Add precaution for use of BitCounter::ntz --- tool/util/bit_counter.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tool/util/bit_counter.h b/tool/util/bit_counter.h index 40469d098..5089fbf48 100644 --- a/tool/util/bit_counter.h +++ b/tool/util/bit_counter.h @@ -74,6 +74,8 @@ struct BitCounter { /** * Count rightmost zeros before the first one (Number of trailing zeros) + * Be careful, if input equals to 0, then total number of corresponding type bits + * will be returned like (unsigned int)0 => 32. * @param bits results */ static T ntz(const T &v) {