[llvm] r253395 - Fix read-of-uninitialized introduced in r253277 exposed on some buildbots

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 15:26:07 PST 2015


Author: dblaikie
Date: Tue Nov 17 17:26:06 2015
New Revision: 253395

URL: http://llvm.org/viewvc/llvm-project?rev=253395&view=rev
Log:
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

Modified:
    llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h

Modified: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h?rev=253395&r1=253394&r2=253395&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h Tue Nov 17 17:26:06 2015
@@ -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;




More information about the llvm-commits mailing list