diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index c57cf310e69..a954eaea3f4 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -250,7 +250,8 @@ unsigned DwarfUnits::getStringPoolIndex(StringRef Str) { unsigned DwarfUnits::getAddrPoolIndex(const MCSymbol *Sym) { std::pair::iterator, bool> P = AddressPool.insert(std::make_pair(Sym, NextAddrPoolNumber)); - NextAddrPoolNumber += P.second; + if (P.second) + ++NextAddrPoolNumber; return P.first->second; }