[llvm] r330764 - [wasm] Fix uninitialized memory introduced in r330749.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 24 13:30:57 PDT 2018


Author: chandlerc
Date: Tue Apr 24 13:30:56 2018
New Revision: 330764

URL: http://llvm.org/viewvc/llvm-project?rev=330764&view=rev
Log:
[wasm] Fix uninitialized memory introduced in r330749.

Found with MSan. This was causing all the WASM MC tests to fail about
10% of the time.

Modified:
    llvm/trunk/lib/MC/WasmObjectWriter.cpp

Modified: llvm/trunk/lib/MC/WasmObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WasmObjectWriter.cpp?rev=330764&r1=330763&r2=330764&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WasmObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WasmObjectWriter.cpp Tue Apr 24 13:30:56 2018
@@ -216,7 +216,7 @@ class WasmObjectWriter : public MCObject
   std::vector<WasmCustomSection> CustomSections;
   unsigned NumFunctionImports = 0;
   unsigned NumGlobalImports = 0;
-  uint32_t SectionCount;
+  uint32_t SectionCount = 0;
 
   // TargetObjectWriter wrappers.
   bool is64Bit() const { return TargetObjectWriter->is64Bit(); }




More information about the llvm-commits mailing list