[lld] ccec22b - [lld][NFC] Silence -Wuninitialized GCC 11 warnings. (#75183)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 05:45:46 PST 2023


Author: Jacek Caban
Date: 2023-12-12T14:45:42+01:00
New Revision: ccec22b675195bf45a5e34583a866ab881f94dde

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

LOG: [lld][NFC] Silence -Wuninitialized GCC 11 warnings. (#75183)

Use of those variables is guarded by lastType, so they are not actually used uninitialized.

Added: 
    

Modified: 
    lld/COFF/Writer.cpp

Removed: 
    


################################################################################
diff  --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp
index 7b1ff8071e2e3d..89e0f5b2df7441 100644
--- a/lld/COFF/Writer.cpp
+++ b/lld/COFF/Writer.cpp
@@ -560,7 +560,7 @@ void Writer::createECCodeMap() {
   codeMap.clear();
 
   std::optional<chpe_range_type> lastType;
-  Chunk *first, *last;
+  Chunk *first = nullptr, *last = nullptr;
 
   auto closeRange = [&]() {
     if (lastType) {


        


More information about the llvm-commits mailing list