-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[IRGen] Fix emitPrimitiveLoadPayloadAndExtraTag for CVW #75270
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
Conversation
@swift-ci smoke test |
rdar://129627898 When casting the projectedBits to Int8, we accidetnally passed the base addr instead of the projectedBits. This was causing the wrong bits to be read.
@swift-ci smoke test |
case x(AnyObject) | ||
case y(Int) | ||
case x(Int) | ||
case y(AnyObject) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for this change is that the bug was masked by the fact that we were using tag 0 in the test. The bug caused the first byte of the object to be read, instead of the tag byte. When this is a reference, it will always cause the tag to be read as 0, causing the test to succeed. So now we are using 1, which should make the test more reliable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we duplicate this test and verify both declaration orders? (For the main PR only; the 6.0 cherry-pick doesn't need to wait for that.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For that matter, what happens with a 257-element enum? Does that end up with a 9-bit tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we only treat 1-bit tags like that, everything else uses full bytes. Yes, I can add the other order as well.
rdar://129627898
When casting the projectedBits to Int8, we accidetnally passed the base addr instead of the projectedBits. This was causing the wrong bits to be read.