summaryrefslogtreecommitdiff
path: root/AK/Optional.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-24 10:22:27 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-24 10:22:27 +0100
commit17846dd06396c196ea200386031875a26dbc16b3 (patch)
tree3f121c810d333d04e65574131f515f75ee6e6d43 /AK/Optional.h
parent0763f670435f30087d285077bf24bfbef9f76b11 (diff)
downloadserenity-17846dd06396c196ea200386031875a26dbc16b3.zip
AK: Zero-initialize the internal storage of Optional
Diffstat (limited to 'AK/Optional.h')
-rw-r--r--AK/Optional.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/AK/Optional.h b/AK/Optional.h
index 4c27ea545d..80986dca78 100644
--- a/AK/Optional.h
+++ b/AK/Optional.h
@@ -160,7 +160,7 @@ private:
ASSERT(m_has_value);
return *reinterpret_cast<const T*>(&m_storage);
}
- char m_storage[sizeof(T)];
+ u8 m_storage[sizeof(T)] { 0 };
bool m_has_value { false };
};