diff --git a/.clang-tidy b/.clang-tidy index 5589a33bfb..69c5b09b41 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -12,7 +12,6 @@ Checks: > -bugprone-unused-raii, cert-*, -cert-err58-cpp, - -cert-oop54-cpp, -clang-analyzer-*, clang-diagnostic-*, concurrency-*, diff --git a/silkworm/core/common/small_map.hpp b/silkworm/core/common/small_map.hpp index 0755c356e2..7ea9b36803 100644 --- a/silkworm/core/common/small_map.hpp +++ b/silkworm/core/common/small_map.hpp @@ -59,6 +59,9 @@ class SmallMap { } } constexpr SmallMap& operator=(const SmallMap& other) { + if (this == &other) { + return *this; + } size_ = other.size_; for (size_t i{0}; i < max_size; ++i) { data_[i] = other.data_[i]; diff --git a/silkworm/core/concurrency/resettable_once_flag.hpp b/silkworm/core/concurrency/resettable_once_flag.hpp index c4af219996..f3e1bb2610 100644 --- a/silkworm/core/concurrency/resettable_once_flag.hpp +++ b/silkworm/core/concurrency/resettable_once_flag.hpp @@ -45,6 +45,9 @@ class ResettableOnceFlag { } } ResettableOnceFlag& operator=(const ResettableOnceFlag& other) { + if (this == &other) { + return *this; + } const uint32_t other_flag{other.flag_.load(std::memory_order_acquire)}; if (other_flag == absl::base_internal::kOnceDone) { flag_.store(absl::base_internal::kOnceDone, std::memory_order_release);