Skip to content

Change ClangImporter if check to an assertion #7488

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
Feb 16, 2017
Merged

Change ClangImporter if check to an assertion #7488

merged 1 commit into from
Feb 16, 2017

Conversation

hughbe
Copy link
Contributor

@hughbe hughbe commented Feb 15, 2017

Below (https://github.com/hughbe/swift/blob/f379108fa17976c8271774fa8694a337fb7f892f/lib/ClangImporter/ImportType.cpp#L1537) we have clangDecl->hasAttr.... This means that we would be dereference a null pointer.

Also, the function doesn't really make sense to import the type if the decl is null (https://github.com/hughbe/swift/blob/f379108fa17976c8271774fa8694a337fb7f892f/lib/ClangImporter/ImportType.cpp#L1544) as there will be no return type

@jrose-apple

@hughbe
Copy link
Contributor Author

hughbe commented Feb 15, 2017

@swift-ci please smoke test

Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

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

Maybe we were trying to use this for macro imports at some point. Thanks, Hugh!

@hughbe hughbe merged commit 7afa43c into swiftlang:master Feb 16, 2017
@hughbe hughbe deleted the clangdecl-assert branch February 16, 2017 08:43
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