From 8b8222b04c1df311d8c1a820d0daa20092e954b2 Mon Sep 17 00:00:00 2001 From: George Rimar Date: Thu, 29 Oct 2015 19:30:28 +0000 Subject: [PATCH] [ELF2] merge-string.s test fixed for win32 configuration. Differential revision: http://reviews.llvm.org/D14171 llvm-svn: 251644 --- lld/ELF/InputSection.cpp | 6 +++--- lld/ELF/InputSection.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index dd8a8c61785a0..1e5f37b86f9f7 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -164,7 +164,7 @@ MergeInputSection::getOffset(uintX_t Offset) { // Find the element this offset points to. auto I = std::upper_bound( this->Offsets.begin(), this->Offsets.end(), Offset, - [](const uintX_t &A, const std::pair &B) { + [](const uintX_t &A, const std::pair &B) { return A < B.first; }); size_t End = I == this->Offsets.end() ? Data.size() : I->first; @@ -173,8 +173,8 @@ MergeInputSection::getOffset(uintX_t Offset) { // Compute the Addend and if the Base is cached, return. uintX_t Addend = Offset - Start; - uintX_t &Base = I->second; - if (Base != uintX_t(-1)) + size_t &Base = I->second; + if (Base != size_t(-1)) return Base + Addend; // Map the base to the offset in the output section and cashe it. diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h index 2e245cac193eb..4eb9528693126 100644 --- a/lld/ELF/InputSection.h +++ b/lld/ELF/InputSection.h @@ -84,7 +84,7 @@ template class MergeInputSection : public InputSectionBase { typedef typename llvm::object::ELFFile::Elf_Shdr Elf_Shdr; public: - std::vector> Offsets; + std::vector> Offsets; MergeInputSection(ObjectFile *F, const Elf_Shdr *Header); static bool classof(const InputSectionBase *S); // Translate an offset in the input section to an offset in the output