-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[cxx-interop] Bitfield setter/getter for SWIFT_UNSAFE_REFERENCE crashes frontend #80182
Comments
Note that this blocks marking GC::Cell and GC::Cell::Visitor as |
I was able to reproduce this issue, thanks for the concise example! Could you make |
In Swift, only value types can have mutating instance member functions or computed properties. The importer logic was violating this invariant when generating setters for bit fields of shared references. Fixes #80182
I have a fix, fortunately it was not too bad: #80197 Do you need this to be back ported to a stable release? No promises, but can look into it if you need it sooner than 6.2. |
Thanks for the quick fix! I don't think I'm super worried about back ports for a while 😅. As long as it builds on main that will be good enough for our Linux uses. Though if 6.2 is current main that sounds like it wouldn't make it until the next Xcode release? I can look at using regular bools for this class when building "for swift". Though the fact that we have 3 bit fields, two bools and one |
Sounds great!
Unfortunately, I cannot share anything about the release schedule. |
In Swift, only value types can have mutating instance member functions or computed properties. The importer logic was violating this invariant when generating setters for bit fields of shared references. Fixes #80182
In Swift, only value types can have mutating instance member functions or computed properties. The importer logic was violating this invariant when generating setters for bit fields of shared references. Fixes #80182
Gotcha. In that case, it would be great to see this in 6.1-dev or similar. Though I am coming across another issue that makes it so I cannot |
Description
A SWIFT_UNSAFE_REFERENCE class with a getter/setter for a bitfield member crashes the frontend when using `-emit-clang-header-path
Reproduction
Test.h
module.modulemap
main.swift
Test with:
Stack dump
Expected behavior
Compiles with no issues
Environment
Swift version 6.2-dev (LLVM 162ee50b401fff2, Swift 57288d1)
Target: x86_64-unknown-linux-gnu
Build config: +assertions
Ubuntu 24.04
Additional information
No response
The text was updated successfully, but these errors were encountered: