mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:27:46 +00:00
Kernel: Fix KResultOr move constructor not copying errors.
This commit is contained in:
parent
27203369b4
commit
d211307547
1 changed files with 5 additions and 1 deletions
|
@ -53,7 +53,11 @@ public:
|
|||
|
||||
KResultOr(KResultOr&& other)
|
||||
{
|
||||
new (&m_storage) T(move(other.value()));
|
||||
m_is_error = other.m_is_error;
|
||||
if (m_is_error)
|
||||
m_error = other.m_error;
|
||||
else
|
||||
new (&m_storage) T(move(other.value()));
|
||||
other.m_is_error = true;
|
||||
other.m_error = KSuccess;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue