[PATCH] D154875: [MicrosoftDemangle] fix warn-trailing false positive
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 11 09:26:18 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6641d2b7df35: [MicrosoftDemangle] fix warn-trailing false positive (authored by nickdesaulniers).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154875/new/
https://reviews.llvm.org/D154875
Files:
llvm/lib/Demangle/MicrosoftDemangle.cpp
llvm/test/Demangle/warn-trailing.test
Index: llvm/test/Demangle/warn-trailing.test
===================================================================
--- llvm/test/Demangle/warn-trailing.test
+++ llvm/test/Demangle/warn-trailing.test
@@ -4,3 +4,8 @@
; CHECK: ?x@@3HAasdf
; CHECK-NEXT: int x
; CHECK-NEXT: warning: trailing characters: asdf
+
+.?AVNet@@
+; CHECK: .?AVNet@@
+; CHECK-NEXT: class Net `RTTI Type Descriptor Name'
+; CHECK-NOT: warning: trailing characters
Index: llvm/lib/Demangle/MicrosoftDemangle.cpp
===================================================================
--- llvm/lib/Demangle/MicrosoftDemangle.cpp
+++ llvm/lib/Demangle/MicrosoftDemangle.cpp
@@ -2404,7 +2404,8 @@
std::string_view Name{MangledName};
SymbolNode *AST = D.parse(Name);
if (!D.Error && NMangled)
- *NMangled = Name.empty() ? 0 : &*Name.begin() - &*MangledName.begin();
+ *NMangled = Name.empty() ? MangledName.size()
+ : &*Name.begin() - &*MangledName.begin();
if (Flags & MSDF_DumpBackrefs)
D.dumpBackReferences();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154875.539149.patch
Type: text/x-patch
Size: 1028 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230711/557e3e14/attachment.bin>
More information about the llvm-commits
mailing list