Skip to content
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

[SR-9336] importing structures with anonymous fields crashes the ClangImporter #51806

Open
compnerd opened this issue Nov 25, 2018 · 2 comments
Labels
Android Platform: Android compiler The Swift compiler itself good first issue Good for newcomers improvement Linux Platform: Linux Windows Platform: Windows

Comments

@compnerd
Copy link
Member

Previous ID SR-9336
Radar None
Original Reporter @compnerd
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, Android, ClangImporter, Linux, StarterBug, Windows
Assignee None
Priority Medium

md5: e340d6800850b57905470aa79f4a8815

Issue Description:

Seems that the typo correction on windows asserts trying to create an anonymous field accessor. This occurred at least in Data.swift in swift-corelibs-foundation trying to typo correct munmap.

@belkadan
Copy link
Contributor

I bet this reproduces on other platforms if you can figure out what it was trying to import.

@compnerd
Copy link
Member Author

compnerd commented Mar 1, 2019

This is due to the use of anonymous fields in structures which Microsoft uses extensively in the Windows SDK. Something like this does the trick:

```
import WinSDK
_ = htont()
```

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Platform: Android compiler The Swift compiler itself good first issue Good for newcomers improvement Linux Platform: Linux Windows Platform: Windows
Projects
None yet
Development

No branches or pull requests

2 participants