mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:17:44 +00:00
AK: Optional::operator=(Optional&&) should clear movee's has_value bit
We were forgetting to clear m_has_value in the Optional being moved from when using operator=(Optional&&).
This commit is contained in:
parent
cd08c8e1bf
commit
9553ecfe01
3 changed files with 34 additions and 0 deletions
|
@ -104,6 +104,7 @@ public:
|
|||
ASSERT(m_has_value);
|
||||
T released_value = move(value());
|
||||
value().~T();
|
||||
m_has_value = false;
|
||||
return released_value;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue