[PATCH] D138313: [bolt] Fix std::prev()-past-begin in veneer handling code

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 11:42:28 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf65e8c3c519a: [bolt] Fix std::prev()-past-begin in veneer handling code (authored by thakis).
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138313/new/

https://reviews.llvm.org/D138313

Files:
  bolt/lib/Core/BinaryContext.cpp


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));
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138313.476544.patch
Type: text/x-patch
Size: 647 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221118/c32c12c7/attachment.bin>


More information about the llvm-commits mailing list