diff --git a/core/shared_ptr.hh b/core/shared_ptr.hh index fd77c32060..4fec292d35 100644 --- a/core/shared_ptr.hh +++ b/core/shared_ptr.hh @@ -326,7 +326,7 @@ public: } template ::value>> shared_ptr& operator=(const shared_ptr& x) noexcept { - if (this != &x) { + if (*this != x) { this->~shared_ptr(); new (this) shared_ptr(x); } @@ -334,7 +334,7 @@ public: } template ::value>> shared_ptr& operator=(shared_ptr&& x) noexcept { - if (this != &x) { + if (*this != x) { this->~shared_ptr(); new (this) shared_ptr(std::move(x)); }