Skip to content

Commit

Permalink
snapshots seg: clz UBSAN fix (#1795)
Browse files Browse the repository at this point in the history
  • Loading branch information
battlmonstr authored Feb 1, 2024
1 parent 2ecfc88 commit f0edd23
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions silkworm/node/snapshots/seg/compressor/patricia_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ struct State {

//! Count leading zero bits.
static inline uint32_t clz32(uint32_t x) {
if (x == 0) return 32;
return static_cast<uint32_t>(__builtin_clz(x));
}

Expand Down

0 comments on commit f0edd23

Please sign in to comment.