From 35033e4699d3356db509e49cb84962679e5c74f5 Mon Sep 17 00:00:00 2001 From: "Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com)" Date: Mon, 22 Jun 2020 11:30:46 +0100 Subject: Check for self-move in every move assignment operator. --- include/llfio/v2.0/path_handle.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/llfio/v2.0/path_handle.hpp') diff --git a/include/llfio/v2.0/path_handle.hpp b/include/llfio/v2.0/path_handle.hpp index 816caec3..a931bd42 100644 --- a/include/llfio/v2.0/path_handle.hpp +++ b/include/llfio/v2.0/path_handle.hpp @@ -81,6 +81,10 @@ public: //! Move assignment permitted path_handle &operator=(path_handle &&o) noexcept { + if(this == &o) + { + return *this; + } this->~path_handle(); new(this) path_handle(std::move(o)); return *this; -- cgit v1.2.3