Kernel: Fix KResultOr copy-move from itself case

If move-assigning from itself we shouldn't do anything.
This commit is contained in:
Tom 2021-02-07 14:55:56 -07:00 committed by Andreas Kling
commit 27a395d964
Notes: sideshowbarker 2024-07-18 22:31:44 +09:00

View file

@ -111,6 +111,8 @@ public:
KResultOr& operator=(KResultOr&& other)
{
if (&other == this)
return *this;
if (!m_is_error && m_have_storage) {
value().~T();
m_have_storage = false;