[llvm] c956f91 - [RISCV][MC][MSan] Fix uninitialized data members

Jordan Rupprecht via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 28 17:08:21 PDT 2023


Author: Jordan Rupprecht
Date: 2023-07-28T17:08:14-07:00
New Revision: c956f915cd4cd365cb071393977306fef3aa643b

URL: https://github.com/llvm/llvm-project/commit/c956f915cd4cd365cb071393977306fef3aa643b
DIFF: https://github.com/llvm/llvm-project/commit/c956f915cd4cd365cb071393977306fef3aa643b.diff

LOG: [RISCV][MC][MSan] Fix uninitialized data members

Added in a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8. Some fields are not always initialized.

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
index f14c531b2e2968..a6f54bf67b5d2b 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
@@ -22,9 +22,9 @@ class RISCVELFStreamer : public MCELFStreamer {
 
   enum ElfMappingSymbol { EMS_None, EMS_Instructions, EMS_Data };
 
-  int64_t MappingSymbolCounter;
+  int64_t MappingSymbolCounter = 0;
   DenseMap<const MCSection *, ElfMappingSymbol> LastMappingSymbols;
-  ElfMappingSymbol LastEMS;
+  ElfMappingSymbol LastEMS = EMS_None;
 
 public:
   RISCVELFStreamer(MCContext &C, std::unique_ptr<MCAsmBackend> MAB,


        


More information about the llvm-commits mailing list