mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 06:02:07 +03:00
Kernel: Fix KResultOr move constructor not copying errors.
This commit is contained in:
parent
27203369b4
commit
d211307547
Notes:
sideshowbarker
2024-07-19 13:37:29 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/d2113075478 Pull-request: https://github.com/SerenityOS/serenity/pull/227 Reviewed-by: https://github.com/awesomekling
@ -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…
Reference in New Issue
Block a user