[lld] d1b418f - [ELF] Reset two member variables in Ctx::reset

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 13:51:06 PDT 2023


Author: Fangrui Song
Date: 2023-09-11T13:51:01-07:00
New Revision: d1b418f55263ec48d14f220ad020d55f126cfcab

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

LOG: [ELF] Reset two member variables in Ctx::reset

Otherwise they are dangling if lldMain is called more than once.

Added: 
    

Modified: 
    lld/ELF/Driver.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 0b24354b3b8df47..9219314111610d1 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -104,7 +104,9 @@ void Ctx::reset() {
   nonPrevailingSyms.clear();
   whyExtractRecords.clear();
   backwardReferences.clear();
+  auxiliaryFiles.clear();
   hasSympart.store(false, std::memory_order_relaxed);
+  hasTlsIe.store(false, std::memory_order_relaxed);
   needsTlsLd.store(false, std::memory_order_relaxed);
   scriptSymOrderCounter = 1;
   scriptSymOrder.clear();


        


More information about the llvm-commits mailing list