[lld-macho][nfc] Fix uninitialized members warning from Coverity
authorJez Ng <jezng@fb.com>
Thu, 10 Jun 2021 19:06:20 +0000 (15:06 -0400)
committerJez Ng <jezng@fb.com>
Thu, 10 Jun 2021 19:09:07 +0000 (15:09 -0400)
We were always assigning to this member before using it, but just to be
safe...

See https://lists.llvm.org/pipermail/llvm-dev/2021-June/151029.html

lld/MachO/InputSection.h

index 8590d72..d8f283c 100644 (file)
@@ -104,7 +104,7 @@ struct StringPiece {
   uint32_t inSecOff;
   uint32_t hash;
   // Offset from the start of the containing output section.
-  uint64_t outSecOff;
+  uint64_t outSecOff = 0;
 
   StringPiece(uint64_t off, uint32_t hash) : inSecOff(off), hash(hash) {}
 };