1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:37:36 +00:00

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
parent b22740c08e
commit 27a395d964

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;