Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix personality_fn within the compiler_builtins
compiler_builtins may not have any unwinding within it to link correctly. This is notoriously
finicky, and this small piece of change removes yet another case where personality function
happens to get introduced.

Side note: I do remember solving the exact same thing before. I wonder why it has reappered...
  • Loading branch information
nagisa committed Mar 4, 2017
1 parent f0b5145 commit 8f581cc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/libcompiler_builtins/lib.rs
Expand Up @@ -402,15 +402,16 @@ pub mod reimpls {
}

trait AbsExt: Sized {
fn uabs(self) -> u128 {
self.iabs() as u128
}
fn uabs(self) -> u128;
fn iabs(self) -> i128;
}

impl AbsExt for i128 {
fn uabs(self) -> u128 {
self.iabs() as u128
}
fn iabs(self) -> i128 {
let s = self >> 127;
let s = self.wrapping_shr(127);
((self ^ s).wrapping_sub(s))
}
}
Expand Down

0 comments on commit 8f581cc

Please sign in to comment.