[PATCH] D149675: [Demangle] convert itaniumDemangle and nonMicrosoftDemangle to use std::string_view

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 15:31:44 PDT 2023


nickdesaulniers planned changes to this revision.
nickdesaulniers added inline comments.


================
Comment at: llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp:89-93
+  if (!Undecorated && DecoratedStr.substr(6) == "__imp_") {
     Prefix = "import thunk for ";
-    Undecorated = itaniumDemangle(DecoratedStr + 6, nullptr, nullptr, nullptr);
+    Undecorated =
+        itaniumDemangle(DecoratedStr.substr(6), nullptr, nullptr, nullptr);
   }
----------------
This needs a bounds check; otherwise a few lllvm-cxxfilt tests fail an assertion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149675



More information about the llvm-commits mailing list