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

Update deps, address soundness issue in msg_send macro #219

Merged
merged 1 commit into from
Oct 23, 2019
Merged

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Oct 22, 2019

As described in rust-objc#62, the msg_send macro could cause
UB in certain situations when built with a version of rustc that
includes the ! type.

Copy link
Contributor

@raphlinus raphlinus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look like good changes in general. Have we verified that the return type of all the methods affected is in fact void?

@SSheldon
Copy link

@cmyr mentioned over in SSheldon/rust-objc#83:

In that thread raph makes a good point, which is that reflexively casting unused results to () might cause other problems. Is there any room for concern here? I would expect to be able to cast any id to a void*, but I'm not sure about casting to void. 😕

Definitely not an expert here, but I can say that the objc runtime uses different msg_send primitives on certain architectures between returns for floating point, structs, or other types. These mainly matter so that messaging nil gives a properly zeroed output. But there could be other spooky undefined behavior consequences?

Anyways, although I don't know of any specific problems you'd see, I'd say it is worth giving a quick audit while you're at it to see what the return type should be for the omitted returns. Hopefully not too hard, lots of them are setters which almost always return void in objc.

@cmyr cmyr force-pushed the update-deps branch 3 times, most recently from e8c19e0 to 31fa870 Compare October 23, 2019 13:58
As described in [rust-objc#62][], the msg_send macro could cause
UB in certain situations when built with a version of rustc that
includes the ! type.

[rust-objc#62]: SSheldon/rust-objc#62
@cmyr
Copy link
Member Author

cmyr commented Oct 23, 2019

Thanks @SSheldon!

@cmyr cmyr deleted the update-deps branch October 23, 2019 21:05
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.

3 participants