Skip to content

Commit 8c1d70a

Browse files
committed
---
yaml --- r: 140424 b: refs/heads/try2 c: f8dffc6 h: refs/heads/master v: v3
1 parent f698c67 commit 8c1d70a

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: db6a62c537852a30f030f866598c358d01fb95cd
8+
refs/heads/try2: f8dffc6789113a10c9dbf1d815c3569b19b53e96
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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)