Skip to content

Conversation

@mikeash
Copy link
Contributor

@mikeash mikeash commented Nov 5, 2025

Complex equality is encoded in the low bit of the witness table pointer. We need to mask off the low bits when bitcasting to an any SerialExecutor.

rdar://164005854

@mikeash mikeash requested a review from al45tair November 5, 2025 19:49
@mikeash mikeash requested a review from ktoso as a code owner November 5, 2025 19:49
@mikeash
Copy link
Contributor Author

mikeash commented Nov 5, 2025

@swift-ci please test

Complex equality is encoded in the low bit of the witness table pointer. We need to mask off the low bits when bitcasting to an `any SerialExecutor`.

rdar://164005854
@mikeash mikeash force-pushed the fix-complex-equality-executor-bitcast branch from ba9d8fd to 8fbf0e0 Compare November 6, 2025 18:21
@mikeash
Copy link
Contributor Author

mikeash commented Nov 6, 2025

I thought I was taking advantage of the lower-level APIs by using alignedDown to do this masking, but that just angers various asserts in the implementation of unsafe pointers. Best to use UInt instead, and not risk having an unrepresentable value in an UnsafeRawPointer.

@mikeash
Copy link
Contributor Author

mikeash commented Nov 6, 2025

@swift-ci please test

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.

1 participant