From a076c287de55bd69328fbf542bf769ca20a12ab4 Mon Sep 17 00:00:00 2001 From: Ben Blum Date: Thu, 16 Aug 2012 18:06:06 -0400 Subject: [PATCH] Fix issue-506.rs by adding a void-returning stub in the runtime (close #2957) --- src/rt/rust_builtin.cpp | 2 ++ src/rt/rustrt.def.in | 1 + src/test/run-pass/issue-506.rs | 6 ++---- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 465eb6efe38..8fd8bdc7c45 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -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; diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 9710d4acb27..5995d95b331 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -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 diff --git a/src/test/run-pass/issue-506.rs b/src/test/run-pass/issue-506.rs index 5d0ceefeb3c..45a8ef26794 100644 --- a/src/test/run-pass/issue-506.rs +++ b/src/test/run-pass/issue-506.rs @@ -1,4 +1,3 @@ -// xfail-test /* A reduced test case for Issue #506, provided by Rob Arnold. @@ -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); }