From 08a34531111ce02e0db9c7deed291f65508593bd Mon Sep 17 00:00:00 2001 From: Valerii Hiora Date: Thu, 21 Aug 2014 11:09:23 +0300 Subject: [PATCH 1/2] iOS compilation fix --- src/libstd/rt/backtrace.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/rt/backtrace.rs b/src/libstd/rt/backtrace.rs index a4491b2ab1d46..87d30ca1fbddf 100644 --- a/src/libstd/rt/backtrace.rs +++ b/src/libstd/rt/backtrace.rs @@ -273,9 +273,9 @@ mod imp { try!(writeln!(w, "stack backtrace:")); // 100 lines should be enough - static SIZE: libc::c_int = 100; + static SIZE: uint = 100; let mut buf: [*mut libc::c_void, ..SIZE] = unsafe {mem::zeroed()}; - let cnt = unsafe { backtrace(buf.as_mut_ptr(), SIZE) as uint}; + let cnt = unsafe { backtrace(buf.as_mut_ptr(), SIZE as libc::c_int) as uint}; // skipping the first one as it is write itself result::fold_(range(1, cnt).map(|i| { From 69fbef1d87ffc4807ff75676f30c7ea30bb11a96 Mon Sep 17 00:00:00 2001 From: Valerii Hiora Date: Thu, 21 Aug 2014 11:10:03 +0300 Subject: [PATCH 2/2] Fixed unwinding for iOS Was broken by Windows adoption --- src/librustrt/unwind.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/librustrt/unwind.rs b/src/librustrt/unwind.rs index 204128cf6be71..58012002c4f63 100644 --- a/src/librustrt/unwind.rs +++ b/src/librustrt/unwind.rs @@ -333,7 +333,10 @@ pub mod eabi { uw::_URC_HANDLER_FOUND // catch! } else { // cleanup phase - uw::_URC_INSTALL_CONTEXT + unsafe { + __gcc_personality_sj0(_version, actions, _exception_class, _ue_header, + _context) + } } } }