Skip to content

Fix ARM unwinding. #11301

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 1 commit into from
Jan 4, 2014
Merged

Fix ARM unwinding. #11301

merged 1 commit into from
Jan 4, 2014

Conversation

vadimcn
Copy link
Contributor

@vadimcn vadimcn commented Jan 4, 2014

This fixes stack unwinding on targets using ARM EHABI.
closes #11147

@vadimcn
Copy link
Contributor Author

vadimcn commented Jan 4, 2014

cc #11281

@@ -59,8 +59,7 @@ use any::{Any, AnyRefExt};
use c_str::CString;
Copy link
Member

Choose a reason for hiding this comment

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

This file seems to have become executable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean?

Copy link
Member

Choose a reason for hiding this comment

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

The mode on this file (and some of them above as well) have changed from 644 to 755

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, that's what those are for!

@alexcrichton
Copy link
Member

Awesome work, thanks for looking into this!

@brson, are you ok with merging this instead of #11281?

@vadimcn
Copy link
Contributor Author

vadimcn commented Jan 4, 2014

updated

uw::_URC_HANDLER_FOUND // catch!
// ARM EHABI uses a slightly different personality routine signature,
// but otherwise works the same.
#[cfg(target_os = "android")]
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be #[cfg(target_arch = "arm")] instead?

@brson
Copy link
Contributor

brson commented Jan 4, 2014

@alexcrichton yes

@luqmana it does seem like it should be target_arch = "arm" but I r+ed it anyway to get android fixed.

@brson
Copy link
Contributor

brson commented Jan 4, 2014

@vadimcn awesome fix. Thanks for digging through this.

@brson
Copy link
Contributor

brson commented Jan 4, 2014

@vadimcn How did you figure out what ARM needed differently here?

bors added a commit that referenced this pull request Jan 4, 2014
This fixes stack unwinding on targets using ARM EHABI.
closes #11147
@bors bors closed this Jan 4, 2014
@bors bors merged commit cefb2c7 into rust-lang:master Jan 4, 2014
@vadimcn
Copy link
Contributor Author

vadimcn commented Jan 5, 2014

@brson: Mostly by comparing Rust's asm output to clang's, then finding magic switches that turn on EH table generation.

@vadimcn vadimcn deleted the fix-android branch March 1, 2015 08:00
flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 25, 2023
[`useless_conversion`]: don't lint if type parameter has unsatisfiable bounds for `.into_iter()` receiver

Fixes rust-lang#11300.

Before this PR, clippy assumed that if it sees a `f(x.into_iter())` call and the type at that argument position is generic over any `IntoIterator`, then the `.into_iter()` call must be useless because `x` already implements `IntoIterator`, *however* this assumption is not right if the generic parameter has more than just the `IntoIterator` bound (because other traits can be implemented for the IntoIterator target type but not the IntoIterator implementor, as can be seen in the linked issue: `<[i32; 3] as IntoIterator>::IntoIter` satisfies `ExactSizeIterator`, but `[i32; 3]` does not).

So, this PR makes it check that the type parameter only has a single `IntoIterator` bound. It *might* be possible to check if the type of `x` in `f(x.into_iter())` satisfies all the bounds on the generic type parameter as defined on the function (which would allow removing the `.into_iter()` call even with multiple bounds), however I'm not sure how to do that, and the current fix should always work.

**Edit:** This PR has been changed to check if any of the bounds don't hold for the type of the `.into_iter()` receiver, so we can still lint in some cases.

changelog: [`useless_conversion`]: don't lint `.into_iter()` if type parameter has multiple bounds
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.

unwinding problem on android
5 participants