From 96cbf8bca6abe6dbace5fca887021a15b326954b Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 24 May 2017 20:32:23 +0000 Subject: [PATCH] Fix the sanitizer-windows bot. Looks like r303801 broke the sanitizer-windows bot. I don't fully understand what is going on, so I'll partially revert that patch. llvm-svn: 303805 --- lld/COFF/ICF.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lld/COFF/ICF.cpp b/lld/COFF/ICF.cpp index 2e26eb0..da8ca36 100644 --- a/lld/COFF/ICF.cpp +++ b/lld/COFF/ICF.cpp @@ -204,10 +204,15 @@ void ICF::forEachClass(std::function Fn) { // contents and relocations are all the same. void ICF::run(const std::vector &Vec) { // Collect only mergeable sections and group by hash value. - for (Chunk *C : Vec) - if (auto *SC = dyn_cast(C)) + uint32_t NextId = 1; + for (Chunk *C : Vec) { + if (auto *SC = dyn_cast(C)) { if (isEligible(SC)) Chunks.push_back(SC); + else + SC->Class[0] = NextId++; + } + } // Initially, we use hash values to partition sections. for (SectionChunk *SC : Chunks) -- 2.7.4