[PATCH] D90714: [clang]Fix length threshold for MicrosoftMangle md5 hash

Melanie Blower via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 3 13:45:59 PST 2020


mibintc created this revision.
mibintc added a reviewer: majnemer.
Herald added a project: clang.
mibintc requested review of this revision.

Fix off-by-one bug in determining the threshold for when want to shorten very large external names, Microsoft compatibility.
This fixes the bug reported here, https://bugs.llvm.org/show_bug.cgi?id=38868


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90714

Files:
  clang/lib/AST/MicrosoftMangle.cpp


Index: clang/lib/AST/MicrosoftMangle.cpp
===================================================================
--- clang/lib/AST/MicrosoftMangle.cpp
+++ clang/lib/AST/MicrosoftMangle.cpp
@@ -50,7 +50,7 @@
     bool StartsWithEscape = MangledName.startswith("\01");
     if (StartsWithEscape)
       MangledName = MangledName.drop_front(1);
-    if (MangledName.size() <= 4096) {
+    if (MangledName.size() < 4096) {
       OS << str();
       return;
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90714.302680.patch
Type: text/x-patch
Size: 457 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201103/a3568518/attachment.bin>


More information about the cfe-commits mailing list