summaryrefslogtreecommitdiff
path: root/AK/Optional.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-05 21:47:36 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-05 21:47:36 +0200
commit9553ecfe016845eb8ee704928b4e20be8d5aa04d (patch)
treeccdfcf917ccd1424a93488d4bb62300bbb130493 /AK/Optional.h
parentcd08c8e1bf9a1a326db797c8c6fbf19daa7be7b0 (diff)
downloadserenity-9553ecfe016845eb8ee704928b4e20be8d5aa04d.zip
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&&).
Diffstat (limited to 'AK/Optional.h')
-rw-r--r--AK/Optional.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/AK/Optional.h b/AK/Optional.h
index ee6320925e..a73db53bcc 100644
--- a/AK/Optional.h
+++ b/AK/Optional.h
@@ -104,6 +104,7 @@ public:
ASSERT(m_has_value);
T released_value = move(value());
value().~T();
+ m_has_value = false;
return released_value;
}