Skip to content

[SymbolGraphGen] Un-revert #78959 and clean up usage of DenseMap #79124

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 2 commits into from
Feb 6, 2025

Conversation

QuietMisdreavus
Copy link
Contributor

This reverts #79062 and adds a fix for the failures it caused in the source compatibility tester.

As it turns out, operator[] on llvm::DenseMap inserts an empty key into the map, which causes contains() to pass, but operator[] to return a null pointer. This was causing a null-pointer dereference in SymbolGraphGen because i was assuming that contains() would still return false on this empty key. The second commit in this PR changes all my uses of operator[] to use lookup() and insert_or_assign() instead, leaving the map completely empty unless there is actually a public type alias of a private decl.

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please Test Source Compatibility

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test macOS

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test Windows

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test macOS

@QuietMisdreavus QuietMisdreavus merged commit 57450f5 into main Feb 6, 2025
7 checks passed
@QuietMisdreavus QuietMisdreavus deleted the vgm/unrevert-underscore-typedef branch February 6, 2025 15:34
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