[lld-macho] Fix shadowed variable
authorVincent Lee <leevince@fb.com>
Mon, 10 Jan 2022 08:07:42 +0000 (00:07 -0800)
committerVincent Lee <leevince@fb.com>
Mon, 10 Jan 2022 08:20:35 +0000 (00:20 -0800)
This fixes a windows build failure from D115416.

lld/MachO/Writer.cpp

index 3c7bea3..b0ca5ee 100644 (file)
@@ -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();