From 1b1017087be4e842ef0ff43486da8b4e9b085f14 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 27 Feb 2013 12:39:11 -0800 Subject: rt: Make some runtime calls work outside of task context --- src/rt/rust_upcall.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/rt/rust_upcall.cpp') diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 008b470fede..b0e13717b82 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -118,7 +118,12 @@ extern "C" CDECL void upcall_fail(char const *expr, char const *file, size_t line) { - rust_task *task = rust_get_current_task(); + rust_task *task = rust_try_get_current_task(); + if (task == NULL) { + // NOTE: Need to think about what to do here + printf("failure outside of a task"); + abort(); + } s_fail_args args = {task,expr,file,line}; UPCALL_SWITCH_STACK(task, &args, upcall_s_fail); } -- cgit 1.4.1-3-g733a5