[lld] 7a161eb - [lld-macho] Fix shadowed variable

Vincent Lee via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 10 00:25:12 PST 2022


Author: Vincent Lee
Date: 2022-01-10T00:20:35-08:00
New Revision: 7a161eb43b280a6194fef5b65a81ef59921ebf02

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

LOG: [lld-macho] Fix shadowed variable

This fixes a windows build failure from D115416.

Added: 
    

Modified: 
    lld/MachO/Writer.cpp

Removed: 
    


################################################################################
diff  --git a/lld/MachO/Writer.cpp b/lld/MachO/Writer.cpp
index 3c7bea335c669..b0ca5eeaa5ad2 100644
--- a/lld/MachO/Writer.cpp
+++ b/lld/MachO/Writer.cpp
@@ -1123,7 +1123,7 @@ void Writer::writeUuid() {
   threadFutures.reserve(chunks.size());
   for (size_t i = 0; i < chunks.size(); ++i)
     threadFutures.emplace_back(threadPool.async(
-        [&](size_t i) { hashes[i] = xxHash64(chunks[i]); }, i));
+        [&](size_t j) { hashes[j] = xxHash64(chunks[j]); }, i));
   for (std::shared_future<void> &future : threadFutures)
     future.wait();
 


        


More information about the llvm-commits mailing list