mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +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:
parent
b22740c08e
commit
27a395d964
1 changed files with 2 additions and 0 deletions
|
@ -111,6 +111,8 @@ public:
|
||||||
|
|
||||||
KResultOr& operator=(KResultOr&& other)
|
KResultOr& operator=(KResultOr&& other)
|
||||||
{
|
{
|
||||||
|
if (&other == this)
|
||||||
|
return *this;
|
||||||
if (!m_is_error && m_have_storage) {
|
if (!m_is_error && m_have_storage) {
|
||||||
value().~T();
|
value().~T();
|
||||||
m_have_storage = false;
|
m_have_storage = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue