From 4f798fc3589d3a1b4a1ad04518d0c4f6cba795a0 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Sat, 21 May 2016 19:22:46 +0000 Subject: [PATCH] Use uintX_t instead of unsigned. This fixes a potential bug when cross linking very large executables on LLP64 machines such as Windows. On such platform, uintX_t is 64 bits while unsigned is 32 bits. llvm-svn: 270327 --- lld/ELF/OutputSections.cpp | 2 +- lld/ELF/OutputSections.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 1f08db2c0fdf..b16035bfac6d 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -1140,7 +1140,7 @@ void EHOutputSection::addSectionAux(EHInputSection *S, ArrayRef D = S->getSectionData(); uintX_t Offset = 0; - DenseMap OffsetToIndex; + DenseMap OffsetToIndex; while (!D.empty()) { unsigned Index = S->Offsets.size(); S->Offsets.push_back(std::make_pair(Offset, -1)); diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h index 9b69dc01862c..55e6230045b5 100644 --- a/lld/ELF/OutputSections.h +++ b/lld/ELF/OutputSections.h @@ -364,7 +364,7 @@ private: std::vector> Cies; // Maps CIE content + personality to a index in Cies. - llvm::DenseMap, unsigned> CieMap; + llvm::DenseMap, uintX_t> CieMap; bool Finalized = false; };