Skip to content

[Demangle] Add back isSwiftSymbol() entry point for null-terminated strings #13857

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

Merged
merged 1 commit into from
Jan 10, 2018

Conversation

DougGregor
Copy link
Member

This particular API can be safely used with a null-terminated string,
and is used by some clients (e.g., LLDB), so add back a "const char *"
variant that safely accesses a null-terminated string.

…trings.

This particular API can be safely used with a null-terminated string,
and is used by some clients (e.g., LLDB), so add back a "const char *"
variant that safely accesses a null-terminated string.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 0614c78 into swiftlang:master Jan 10, 2018
@DougGregor DougGregor deleted the demangle-is-swift-symbol-cstr branch January 11, 2018 00:57
@@ -139,6 +139,11 @@ bool swift::Demangle::isSwiftSymbol(llvm::StringRef mangledName) {
return getManglingPrefixLength(mangledName) != 0;
}

bool swift::Demangle::isSwiftSymbol(const char *mangledName) {
StringRef mangledNameRef(mangledName, 4);
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if a mangled name is shorter than 4 characters? I happened to notice it and "fixed" it in #14249 but now that I see you introduced this behaviour so recently, I'm now wondering if that was a mistake...

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for fixing; I think it was sloppiness on my part when I re-introduced an old API that already had these issues.

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.

3 participants