[PATCH] D159471: [DWARFVerifier] Allow ObjectiveC names in dwarf_debug tables

Felipe de Azevedo Piovezan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 15:39:05 PDT 2023


fdeazeve added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp:1366
+        // Convert to std::string first, otherwise a vector resize may
+        // destroy the StringRef memory.
+        Result.push_back(StrippedName->str());
----------------
aprantl wrote:
> I'm a little confused by this comment. "first" as opposed to when else?
As opposed to doing an `Result.emplace_back(StrippedName)`, which would first ensure the vector has enough space, and then construct the std::string in-place from the (now possibly invalid) StringRef.

This is extremely subtle, but I will try to reword the comment


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159471



More information about the llvm-commits mailing list