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
Open

Comments

@compnerd
Copy link
Collaborator

@compnerd compnerd commented Nov 25, 2018

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

@belkadan belkadan commented Nov 26, 2018

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

@compnerd
Copy link
Collaborator Author

@compnerd 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
Projects
None yet
Development

No branches or pull requests

2 participants