[llvm] r341945 - pdb output: Initialize padding in PublicsStreamHeader.

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 11 07:11:52 PDT 2018


Author: nico
Date: Tue Sep 11 07:11:52 2018
New Revision: 341945

URL: http://llvm.org/viewvc/llvm-project?rev=341945&view=rev
Log:
pdb output: Initialize padding in PublicsStreamHeader.

Makes the produced pdbs more deterministic; before they'd contain 2 arbitary
bytes where this padding was.

Also reorder initialization to match the order of the fields in the struct (nfc)

Modified:
    llvm/trunk/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp

Modified: llvm/trunk/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp?rev=341945&r1=341944&r2=341945&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp Tue Sep 11 07:11:52 2018
@@ -310,13 +310,14 @@ Error GSIStreamBuilder::commitPublicsHas
   PublicsStreamHeader Header;
 
   // FIXME: Fill these in. They are for incremental linking.
+  Header.SymHash = PSH->calculateSerializedLength();
+  Header.AddrMap = PSH->Records.size() * 4;
   Header.NumThunks = 0;
   Header.SizeOfThunk = 0;
   Header.ISectThunkTable = 0;
+  memset(Header.Padding, 0, sizeof(Header.Padding));
   Header.OffThunkTable = 0;
   Header.NumSections = 0;
-  Header.SymHash = PSH->calculateSerializedLength();
-  Header.AddrMap = PSH->Records.size() * 4;
   if (auto EC = Writer.writeObject(Header))
     return EC;
 




More information about the llvm-commits mailing list