Skip to content

objc: Implement whitelist tracing #557

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

Merged
merged 4 commits into from
Mar 4, 2017
Merged

Conversation

scoopr
Copy link
Contributor

@scoopr scoopr commented Mar 4, 2017

This implements the tracing facility to enable whitelisting.

The most ugly thing is the collecting of the protocol ItemIds that a interface conforms to. I couldn't use the Item::from_ty because the protocols aren't actually types (in clang), I'm just making them look like one, as thats how they behave in bindgens perspective. So I resorted in linear search of all ItemIds, as it was easyish to implement (local to objc.rs), but there are several good avenues to make that faster if it needs to.

The change to naming the types with the rust_name is also a suspect, I'm not totally sure of all the consequences but this allows the protocols/categories to be disambiguated, otherwise there could be multiple type items with the same name. Somehow I feel that I'm forgetting another rationale as well, from when I originally wrote that line few days ago.

Locally I also got a test failure, but to me that does not seem like it was caused by these changes. In call-conv-field.rs:

 extern "stdcall" {
-    #[link_name = "_bar@0"]
+    #[link_name = "bar@0"]
     pub fn bar();
 }

scoopr added 4 commits March 4, 2017 22:27
Allows to disambiguate protocols and interfaces in whitelists
Follows all the method signatures
Keeps note of the ItemIds that the Objective C interface conforms to,
and when tracing, visits also them.
@highfive
Copy link

highfive commented Mar 4, 2017

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@emilio
Copy link
Contributor

emilio commented Mar 4, 2017

Locally I also got a test failure, but to me that does not seem like it was caused by these changes. In call-conv-field.rs.

Hm, yeah, I know why that is and it's unfortunate :(. It's temporary though.

This looks fine, thanks for doing it!

@bors-servo r+

@bors-servo
Copy link

📌 Commit 35159dc has been approved by emilio

@bors-servo
Copy link

⌛ Testing commit 35159dc with merge 6320ed2...

bors-servo pushed a commit that referenced this pull request Mar 4, 2017
objc: Implement whitelist tracing

This implements the tracing facility to enable whitelisting.

The most ugly thing is the collecting of the protocol ItemIds that a interface conforms to. I couldn't use the Item::from_ty because the protocols aren't actually types (in clang), I'm just making them look like one, as thats how they behave in bindgens perspective. So I resorted in linear search of all ItemIds, as it was easyish to implement (local to objc.rs), but there are several good avenues to make that faster if it needs to.

The change to naming the types with the rust_name is also a suspect, I'm not totally sure of all the consequences but this allows the protocols/categories to be disambiguated, otherwise there could be multiple type items with the same name. Somehow I feel that I'm forgetting another rationale as well, from when I originally wrote that line few days ago.

Locally I also got a test failure, but to me that does not seem like it was caused by these changes. In  call-conv-field.rs:
```diff
 extern "stdcall" {
-    #[link_name = "_bar@0"]
+    #[link_name = "bar@0"]
     pub fn bar();
 }
```
@emilio
Copy link
Contributor

emilio commented Mar 4, 2017

I invited you to have write access to the repo (feel free to accept or not if you don't want to). This wouldn't give you review privileges (we usually require a few reviews before that), but would allow you to file/triage/report issues if you need or want to do so.

Thanks for all the good stuff! :)

@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: emilio
Pushing 6320ed2 to master...

@bors-servo bors-servo merged commit 35159dc into rust-lang:master Mar 4, 2017
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.

4 participants