-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Fix ARM unwinding. #11301
Conversation
cc #11281 |
@@ -59,8 +59,7 @@ use any::{Any, AnyRefExt}; | |||
use c_str::CString; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
updated |
uw::_URC_HANDLER_FOUND // catch! | ||
// ARM EHABI uses a slightly different personality routine signature, | ||
// but otherwise works the same. | ||
#[cfg(target_os = "android")] |
There was a problem hiding this comment.
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?
@alexcrichton yes @luqmana it does seem like it should be |
@vadimcn awesome fix. Thanks for digging through this. |
@vadimcn How did you figure out what ARM needed differently here? |
This fixes stack unwinding on targets using ARM EHABI. closes #11147
@brson: Mostly by comparing Rust's asm output to clang's, then finding magic switches that turn on EH table generation. |
[`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
This fixes stack unwinding on targets using ARM EHABI.
closes #11147