about summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-02-27 12:39:11 -0800
committerBrian Anderson <banderson@mozilla.com>2013-02-27 12:39:11 -0800
commit1b1017087be4e842ef0ff43486da8b4e9b085f14 (patch)
treec4a891456c2316f104c7d18261580e956e06d2d7 /src/rt/rust_upcall.cpp
parenta8f07dc9df24af3cf06171bfde1a68b3058e2ec5 (diff)
downloadrust-1b1017087be4e842ef0ff43486da8b4e9b085f14.tar.gz
rust-1b1017087be4e842ef0ff43486da8b4e9b085f14.zip
rt: Make some runtime calls work outside of task context
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp7
1 files changed, 6 insertions, 1 deletions
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);
 }