Index: bolt/lib/Core/BinaryContext.cpp =================================================================== --- bolt/lib/Core/BinaryContext.cpp +++ bolt/lib/Core/BinaryContext.cpp @@ -1191,8 +1191,7 @@ MIB->addAnnotation(Instruction, "AArch64Veneer", true); Veneer->addInstruction(Offset, std::move(Instruction)); --Count; - for (auto It = std::prev(Instructions.end()); Count != 0; - It = std::prev(It), --Count) { + for (auto It = Instructions.rbegin(); Count != 0; ++It, --Count) { MIB->addAnnotation(It->second, "AArch64Veneer", true); Veneer->addInstruction(It->first, std::move(It->second)); }