Add defense for builtin_clz/builtin_ctz in case that input is zero

This commit is contained in:
obdev
2021-07-18 15:24:13 +08:00
committed by wangzelin.wzl
parent 3a6db0a542
commit 4770dbcdcb
9 changed files with 14 additions and 8 deletions

View File

@ -80,6 +80,7 @@ void ObExprEstimateNdv::llc_estimate_ndv(int64_t& result, const ObString& bitmap
}
uint64_t ObExprEstimateNdv::llc_leading_zeros(uint64_t value, uint64_t bit_width)
{
OB_ASSERT(0ULL != value);
return std::min(bit_width, static_cast<uint64_t>(__builtin_clzll(value)));
}