[PATCH] D137616: [BOLT][NFC] Fix possible use-after-free

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 14 05:41:27 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGc92ff2a3c449: [BOLT][NFC] Fix possible use-after-free (authored by revunov.denis at huawei.com <revunov.denis at huawei-partners.com>).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137616

Files:
  bolt/lib/Core/BinaryContext.cpp


Index: bolt/lib/Core/BinaryContext.cpp
===================================================================
--- bolt/lib/Core/BinaryContext.cpp
+++ bolt/lib/Core/BinaryContext.cpp
@@ -2036,9 +2036,9 @@
   deregisterSectionName(Section);
 
   Section.Name = NewName.str();
-  Section.setOutputName(NewName);
+  Section.setOutputName(Section.Name);
 
-  NameToSection.insert(std::make_pair(NewName.str(), &Section));
+  NameToSection.insert(std::make_pair(Section.Name, &Section));
 
   // Reinsert with the new name.
   Sections.insert(&Section);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137616.475120.patch
Type: text/x-patch
Size: 545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221114/d39e9d3b/attachment.bin>


More information about the llvm-commits mailing list