AK: Explicitly initialize buffer member in ByteBuffer

When compiling the Kernel with Og, the compiler complains that
m_outline_capacity might be uninitialized when calling capacity()

Note that this fix is not really what we want. Ideally only outline
buffer and outline capacity would need initialized, not the entire
inline buffer. However, clang considers the class to not be
default-constructible if we make that change, while gcc accepts it.
This commit is contained in:
Andrew Kaster 2021-05-23 13:39:19 -06:00 committed by Andreas Kling
parent 8146543a43
commit 6459c5a713

View file

@ -235,7 +235,7 @@ private:
size_t m_size { 0 };
union {
u8 m_inline_buffer[inline_capacity];
u8 m_inline_buffer[inline_capacity] {};
struct {
u8* m_outline_buffer;
size_t m_outline_capacity;