Skip to content

[LLVM][Demangle] Fix MS Demangler to be stricter about wide string literals #134483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

shafik
Copy link
Collaborator

@shafik shafik commented Apr 5, 2025

Static analysis detected that Demangler::demangleStringLiteral had a potential overflow if not checking StringByteSize properly.

Added check to ensure that for wide string it is always even and that there were the byte count did not mismatch the actual size of the literal.

Fixes: #129970

…terals

Static analysis detected that Demangler::demangleStringLiteral had a potential
overflow if not checking StringByteSize properly.

Added check to ensure that for wide string it is always even and that there were
the byte count did not mismatch the actual size of the literal.

Fixes: llvm#129970
@@ -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

@@ -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
([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)

@shafik shafik merged commit d4c1642 into llvm:main Apr 7, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can StringByteSize in demangleStringLiteral in MicrosoftDemangle.cpp overflow?
3 participants