Skip to content

[SerializeDoc] Don't crash in module-merging with a group info file #27867

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
Oct 24, 2019

Conversation

jrose-apple
Copy link
Contributor

@jrose-apple jrose-apple commented Oct 24, 2019

Group info works by matching source filenames with groups, but in module merging the decls in the module no longer have associated SourceFiles. Long-term, maybe we should switch this to working on filenames directly (using the new support provided by swiftsourceinfo files), but for now just don't crash.

Fixes a bug I introduced in #26734.

rdar://problem/56592085

Group info works by matching source filenames with groups, but in
module merging the decls in the module no longer have associated
SourceFiles. Long-term, maybe we should switch this to working on
filenames directly (using the new support provided by swiftsourceinfo
files), but for now just don't crash.

rdar://problem/56592085
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor Author

Actually, the regression might have come from the swiftsourceinfo changes anyway, since now the SourceLoc is valid even though it's not from a SourceFile. I wonder where else in the compiler we've conflated those two. :-/

@@ -153,8 +153,16 @@ class DeclGroupNameContext {
// We need the file path, so there has to be a location.
if (VD->getLoc().isInvalid())
Copy link
Contributor

Choose a reason for hiding this comment

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

VD->getLoc(false) works too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah. I guess I'll leave it this way because eventually we'll want group info to work in non-single-frontend mode anyway.

@jrose-apple jrose-apple merged commit d8d18d3 into swiftlang:master Oct 24, 2019
@jrose-apple jrose-apple deleted the sourcing-sunction branch October 24, 2019 22:52
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