[all-commits] [llvm/llvm-project] c63adb: [clang] Cap MS RTTI TypeDescriptor name strings li...

mzukovec via All-commits all-commits at lists.llvm.org
Mon Jul 6 14:52:34 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c63adb28aa78ecb300bf06c1d0893ae6259765dd
      https://github.com/llvm/llvm-project/commit/c63adb28aa78ecb300bf06c1d0893ae6259765dd
  Author: mzukovec <martin.zukovec at xlab.si>
  Date:   2026-07-06 (Mon, 06 Jul 2026)

  Changed paths:
    M clang/docs/ReleaseNotes.md
    M clang/lib/AST/MicrosoftMangle.cpp
    M clang/test/CodeGenCXX/mangle-ms-md5.cpp

  Log Message:
  -----------
  [clang] Cap MS RTTI TypeDescriptor name strings like MSVC does (#206317)

On the Microsoft ABI, an RTTI TypeDescriptor stores the type's decorated
name as an inline string. Unlike symbol names, this string was never run
through the MD5 shortening that MSVC applies to over-long decorated
names. Deeply nested template types therefore produced unbounded
writable .data COMDATs: for example a type whose template arguments
contain a local lambda, whose mangled name re-spells the enclosing
template context at every level of nesting, grows exponentially with
depth. A five-level repro emitted an 82 MB object file.

Wrap the TypeDescriptor name string in the same msvc_hashing_ostream
already used for the RTTI symbol. When the name reaches the length limit
it is replaced by ??@<md5>@, mimicking MSVC. MSVC counts the leading .
of the name string toward the 4096-character limit but excludes it from
the hashed input, so the threshold here is one lower than for symbols.

Fixes #206313



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list