Commit f86ebf44 authored by Kenton Varda's avatar Kenton Varda

Merge pull request #299 from maurer/uninitialized_listbuilder

Fix uninitialized members of ListBuilder
parents e1d2d0a7 47b92d31
......@@ -1609,6 +1609,7 @@ struct WireHelpers {
return { segment, ptr };
} else {
// List of structs.
KJ_DASSERT(value.structDataSize % BITS_PER_WORD == 0 * BITS);
word* ptr = allocate(ref, segment, capTable, totalSize + POINTER_SIZE_IN_WORDS,
WirePointer::LIST, orphanArena);
ref->listRef.setInlineComposite(totalSize);
......
......@@ -643,7 +643,8 @@ class ListBuilder: public kj::DisallowConstCopy {
public:
inline explicit ListBuilder(ElementSize elementSize)
: segment(nullptr), capTable(nullptr), ptr(nullptr), elementCount(0 * ELEMENTS),
step(0 * BITS / ELEMENTS), elementSize(elementSize) {}
step(0 * BITS / ELEMENTS), elementSize(elementSize), structDataSize(0 * BITS),
structPointerCount(0 * POINTERS) {}
MSVC_DEFAULT_ASSIGNMENT_WORKAROUND(, ListBuilder)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment