[PATCH] D151760: [Demangle] fix deref of std::string_view::end()

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 31 09:50:00 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG54a2994fa8be: [Demangle] fix deref of std::string_view::end() (authored by nickdesaulniers).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151760

Files:
  llvm/include/llvm/Demangle/ItaniumDemangle.h


Index: llvm/include/llvm/Demangle/ItaniumDemangle.h
===================================================================
--- llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -3714,8 +3714,9 @@
       std::string_view ProtoSourceName(Qual.data() + Len, Qual.size() - Len);
       std::string_view Proto;
       {
-        ScopedOverride<const char *> SaveFirst(First, &*ProtoSourceName.begin()),
-            SaveLast(Last, &*ProtoSourceName.end());
+        ScopedOverride<const char *> SaveFirst(First,
+                                               &*ProtoSourceName.begin()),
+            SaveLast(Last, &*ProtoSourceName.rbegin() + 1);
         Proto = parseBareSourceName();
       }
       if (Proto.empty())


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151760.527097.patch
Type: text/x-patch
Size: 763 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230531/c37e1423/attachment.bin>


More information about the llvm-commits mailing list