Skip to content

Commit

Permalink
Fix issue-506.rs by adding a void-returning stub in the runtime (close
Browse files Browse the repository at this point in the history
  • Loading branch information
bblum committed Aug 17, 2012
1 parent f188d92 commit a076c28
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/rt/rust_builtin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,8 @@ rust_dbg_call(dbg_callback cb, void *data) {
return cb(data);
}

extern "C" CDECL void rust_dbg_do_nothing() { }

extern "C" CDECL void
rust_dbg_breakpoint() {
BREAKPOINT_AWESOME;
Expand Down
1 change: 1 addition & 0 deletions src/rt/rustrt.def.in
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ rust_dbg_lock_unlock
rust_dbg_lock_wait
rust_dbg_lock_signal
rust_dbg_call
rust_dbg_do_nothing
rust_dbg_breakpoint
rust_osmain_sched_id
rust_compare_and_swap_ptr
Expand Down
6 changes: 2 additions & 4 deletions src/test/run-pass/issue-506.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// xfail-test
/*
A reduced test case for Issue #506, provided by Rob Arnold.
Expand All @@ -10,10 +9,9 @@ import task;

#[abi = "cdecl"]
extern mod rustrt {
fn get_task_id() -> libc::intptr_t;
fn rust_dbg_do_nothing();
}

fn main() {
let f: fn() -> libc::intptr_t = rustrt::get_task_id;
task::spawn(unsafe { unsafe::reinterpret_cast(f) });
task::spawn(rustrt::rust_dbg_do_nothing);
}

0 comments on commit a076c28

Please sign in to comment.