Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions llvm/docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ Changes to LLVM infrastructure

* Removed support for target intrinsics being defined in the target directories
themselves (i.e., the `TargetIntrinsicInfo` class).
* Fix Microsoft demanling of string literals to be stricter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Fix Microsoft demanling of string literals to be stricter
* Fix Microsoft demangling of string literals to be stricter

([Fixes 129970](https://github.com/llvm/llvm-project/issues/129970))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
([Fixes 129970](https://github.com/llvm/llvm-project/issues/129970))
(#GH129970)


Changes to building LLVM
------------------------
Expand Down
5 changes: 5 additions & 0 deletions llvm/lib/Demangle/MicrosoftDemangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,11 @@ Demangler::demangleStringLiteral(std::string_view &MangledName) {
Result->IsTruncated = true;

while (!consumeFront(MangledName, '@')) {
// For a wide string StringByteSize has to have an even length.
if (StringByteSize % 2 != 0)
goto StringLiteralError;
if (StringByteSize == 0)
goto StringLiteralError;
if (MangledName.size() < 2)
goto StringLiteralError;
wchar_t W = demangleWcharLiteral(MangledName);
Expand Down
24 changes: 24 additions & 0 deletions llvm/test/Demangle/invalid-manglings.test
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,27 @@
; CHECK-EMPTY:
; CHECK-NEXT: .?AUBase@@@8
; CHECK-NEXT: error: Invalid mangled name

; Begin GH129970

??_C@_12EEHFKJGG@?$AAt?$AAe?$AAx@
; CHECK-EMPTY:
; CHECK-NEXT: ??_C@_12EEHFKJGG@?$AAt?$AAe?$AAx@
; CHECK-NEXT: error: Invalid mangled name

??_C@_16EEHFKJGG@?$AAt?$AAe?$AAx@
; CHECK-EMPTY:
; CHECK-NEXT: ??_C@_16EEHFKJGG@?$AAt?$AAe?$AAx@
; CHECK-NEXT: error: Invalid mangled name

??_C@_18EEHFKJGG@?$AAt?$AAe?$AAx@
; CHECK-EMPTY:
; CHECK-NEXT: ??_C@_18EEHFKJGG@?$AAt?$AAe?$AAx@
; CHECK-NEXT: error: Invalid mangled name

??_C@_15EEHFKJGG@?$AAt?$AAe?$AAx?$AAx@
; CHECK-EMPTY:
; CHECK-NEXT: ??_C@_15EEHFKJGG@?$AAt?$AAe?$AAx?$AAx@
; CHECK-NEXT: error: Invalid mangled name

; End GH129970
Loading