From: David Blaikie Date: Tue, 17 Nov 2015 23:26:06 +0000 (+0000) Subject: Fix read-of-uninitialized introduced in r253277 exposed on some buildbots X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c672a9b1f35de3f045d9bc3171e1b936eb00267a;p=oota-llvm.git Fix read-of-uninitialized introduced in r253277 exposed on some buildbots Verified that this was at least /an/ issue, if not the only one, by initializing NumBuckets to 1 (previously it was uninitialized, so if this change made a difference, which it did (causing a bunch of tests to crash) it demonstrates use-of-uninitialized memory). Initializing then removes the crashes. Thanks Reid for the debugging assistance git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253395 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h b/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h index f2b3010e77b..0d49d7c0cf8 100644 --- a/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h +++ b/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h @@ -33,7 +33,7 @@ class DWARFUnitIndex { uint32_t Version; uint32_t NumColumns; uint32_t NumUnits; - uint32_t NumBuckets; + uint32_t NumBuckets = 0; bool parse(DataExtractor IndexData, uint32_t *OffsetPtr); void dump(raw_ostream &OS) const;