Skip to content

Conversation

patrykstefanski
Copy link

BoundsSafety assumes that void *__single cannot be dereferenced and allows assigning anything to void *__single. This commit ports this behavior to C++ interop.

rdar://156007256

@patrykstefanski patrykstefanski self-assigned this Aug 13, 2025
@patrykstefanski patrykstefanski added the clang:bounds-safety Issue relating to the experimental -fbounds-safety feature in Clang label Aug 13, 2025
@patrykstefanski patrykstefanski force-pushed the eng/pstefanski/PR-156007256 branch from 52102bf to 1974862 Compare August 15, 2025 23:37
@ziqingluo-90
Copy link

LGTM!

@ziqingluo-90
Copy link

Just curious, does BoundsSafety allow casting void *__single to int * __single?

BoundsSafety assumes that `void *__single` cannot be dereferenced and
allows assigning anything to `void *__single`. This commit ports this
behavior to C++ interop.

rdar://156007256
@patrykstefanski patrykstefanski force-pushed the eng/pstefanski/PR-156007256 branch from 1974862 to a2ee8b5 Compare August 25, 2025 22:41
@patrykstefanski
Copy link
Author

@swift-ci test llvm

@patrykstefanski
Copy link
Author

Just curious, does BoundsSafety allow casting void *__single to int * __single?

Yes, apparently this it not a bounds-safety problem, but a type-safety one.

@patrykstefanski
Copy link
Author

Unrelated tests are failing.

@patrykstefanski patrykstefanski merged commit 53149eb into swiftlang:next Aug 26, 2025
0 of 2 checks passed
@patrykstefanski patrykstefanski deleted the eng/pstefanski/PR-156007256 branch August 26, 2025 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:bounds-safety Issue relating to the experimental -fbounds-safety feature in Clang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants