1
Fork 0
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:
Andreas Kling 2019-08-05 21:47:36 +02:00
parent cd08c8e1bf
commit 9553ecfe01
3 changed files with 34 additions and 0 deletions

View file

@ -104,6 +104,7 @@ public:
ASSERT(m_has_value);
T released_value = move(value());
value().~T();
m_has_value = false;
return released_value;
}