From 12c3a063686c0c4f718a45c42480c4db04abeba7 Mon Sep 17 00:00:00 2001 From: Swaroop Sridhar Date: Tue, 6 Dec 2016 17:17:21 -0800 Subject: GcInfoEncoder: Initialize the BitArrays tracking liveness (#8485) The non-X86 GcInfoEncoder library uses two bit-arrays to keep track of pointer-liveness. The BitArrays are allocated using the arena allocator which doesn't zero-initialize them. This was causing non-deterministic redundant allocation of unused slots. This change fixes the problem. --- src/gcinfo/gcinfoencoder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gcinfo/gcinfoencoder.cpp b/src/gcinfo/gcinfoencoder.cpp index c576d6fbbb..15d6ed9ff9 100644 --- a/src/gcinfo/gcinfoencoder.cpp +++ b/src/gcinfo/gcinfoencoder.cpp @@ -1163,7 +1163,8 @@ void GcInfoEncoder::Build() int size_tCount = (m_NumSlots + BITS_PER_SIZE_T - 1) / BITS_PER_SIZE_T; BitArray liveState(m_pAllocator, size_tCount); BitArray couldBeLive(m_pAllocator, size_tCount); - + liveState.ClearAll(); + couldBeLive.ClearAll(); #ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED _ASSERTE(m_NumCallSites == 0 || m_pCallSites != NULL); -- cgit v1.2.3