Skip to content

Commit 8f581cc

Browse files
committed
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...
1 parent f0b5145 commit 8f581cc

File tree

1 file changed

+5
-4
lines changed
  • src/libcompiler_builtins

1 file changed

+5
-4
lines changed

src/libcompiler_builtins/lib.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -402,15 +402,16 @@ pub mod reimpls {
402402
}
403403

404404
trait AbsExt: Sized {
405-
fn uabs(self) -> u128 {
406-
self.iabs() as u128
407-
}
405+
fn uabs(self) -> u128;
408406
fn iabs(self) -> i128;
409407
}
410408

411409
impl AbsExt for i128 {
410+
fn uabs(self) -> u128 {
411+
self.iabs() as u128
412+
}
412413
fn iabs(self) -> i128 {
413-
let s = self >> 127;
414+
let s = self.wrapping_shr(127);
414415
((self ^ s).wrapping_sub(s))
415416
}
416417
}

0 commit comments

Comments
 (0)