Skip to content

Commit be0b679

Browse files
committed
---
yaml --- r: 59919 b: refs/heads/master c: f8dffc6 h: refs/heads/master i: 59917: 8d2b3bf 59915: 1641f27 59911: 860e97d 59903: 3057dcd v: v3
1 parent 946cf32 commit be0b679

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: db6a62c537852a30f030f866598c358d01fb95cd
2+
refs/heads/master: f8dffc6789113a10c9dbf1d815c3569b19b53e96
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2d28d645422c1617be58c8ca7ad9a457264ca850
55
refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589

trunk/src/libcore/sys.rs

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -204,22 +204,32 @@ impl FailWithCause for &'static str {
204204
#[cfg(stage0)]
205205
pub fn begin_unwind(msg: ~str, file: ~str, line: uint) -> ! {
206206

207+
do str::as_buf(msg) |msg_buf, _msg_len| {
208+
do str::as_buf(file) |file_buf, _file_len| {
209+
unsafe {
210+
let msg_buf = cast::transmute(msg_buf);
211+
let file_buf = cast::transmute(file_buf);
212+
begin_unwind_(msg_buf, file_buf, line as libc::size_t)
213+
}
214+
}
215+
}
216+
}
217+
218+
// FIXME #4427: Temporary until rt::rt_fail_ goes away
219+
pub fn begin_unwind_(msg: *c_char, file: *c_char, line: size_t) -> ! {
207220
use rt::{context, OldTaskContext};
208221
use rt::local_services::unsafe_borrow_local_services;
209222

210223
match context() {
211224
OldTaskContext => {
212-
do str::as_buf(msg) |msg_buf, _msg_len| {
213-
do str::as_buf(file) |file_buf, _file_len| {
214-
unsafe {
215-
let msg_buf = cast::transmute(msg_buf);
216-
let file_buf = cast::transmute(file_buf);
217-
begin_unwind_(msg_buf, file_buf, line as libc::size_t)
218-
}
219-
}
225+
unsafe {
226+
gc::cleanup_stack_for_failure();
227+
rustrt::rust_upcall_fail(msg, file, line);
228+
cast::transmute(())
220229
}
221230
}
222231
_ => {
232+
// XXX: Need to print the failure message
223233
gc::cleanup_stack_for_failure();
224234
unsafe {
225235
let local_services = unsafe_borrow_local_services();
@@ -232,15 +242,6 @@ pub fn begin_unwind(msg: ~str, file: ~str, line: uint) -> ! {
232242
}
233243
}
234244

235-
// FIXME #4427: Temporary until rt::rt_fail_ goes away
236-
pub fn begin_unwind_(msg: *c_char, file: *c_char, line: size_t) -> ! {
237-
unsafe {
238-
gc::cleanup_stack_for_failure();
239-
rustrt::rust_upcall_fail(msg, file, line);
240-
cast::transmute(())
241-
}
242-
}
243-
244245
// NOTE: remove function after snapshot
245246
#[cfg(stage0)]
246247
pub fn fail_assert(msg: &str, file: &str, line: uint) -> ! {

0 commit comments

Comments
 (0)