Skip to content

Conversation

@Michael137
Copy link

See commits for details.

rdar://164519648

…llvm#167684)

We've been seeing (rare) crashes from both
`CPlusPlusLanguage::SymbolNameFitsToLanguage` and
`ObjCLanguage::SymbolNameFitsToLanguage` when we try to read contents of
the `ConstString`s of the `Mangled` parameter. I'm not entirely sure how
that can happen (current theory is corrupted stack somehow which
overwrites `ConstString::m_string` to an invalid pointer) but I'm not
able to confirm that.

One thing these crashes had in common is that they operate on the
`Mangled` object we copied into `SymbolNameFitsToLanguage` by value.
While I can't see off the top why that would cause it to contain
unintiailized/corrupt `ConstString`s, the class is sufficiently large
enough to probably pass it by `const &` anyway. This is what this patch
does.

rdar://164519648
(cherry picked from commit 0f4dc93)
…StringRef (llvm#167660)

We've seen some crashes around this area (particularly around
checking/handling raw C-strings). Dealing with `StringRef`s makes it a
bit easier to reason about.

This doesn't fix anything per se, but is an improvement in readability.

rdar://164519648
(cherry picked from commit f6cf44a)
The API was changed in llvm#167684
to take `Mangled` by const-ref.
@Michael137
Copy link
Author

@swift-ci test

@Michael137 Michael137 merged commit 9b056f2 into stable/21.x Nov 12, 2025
3 checks passed
@Michael137 Michael137 deleted the lldb/mangled-nfc-to-21.x branch November 12, 2025 18:03
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.

2 participants