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-05-02 20:51:56 -0700
committerBrian Anderson <banderson@mozilla.com>2013-05-02 20:51:56 -0700
commit6c478c7de889ec4943b9dcdcbfbb8a8244f479cc (patch)
tree7f9fd01150a7611007255cbb2e45cf41e0cd4989 /src/rt/rust_upcall.cpp
parentbaa1c1834f608c8c789db6d2495626ff9d28dd96 (diff)
parentf8dffc6789113a10c9dbf1d815c3569b19b53e96 (diff)
downloadrust-6c478c7de889ec4943b9dcdcbfbb8a8244f479cc.tar.gz
rust-6c478c7de889ec4943b9dcdcbfbb8a8244f479cc.zip
Merge remote-tracking branch 'brson/io' into incoming
Conflicts:
	mk/rt.mk
	src/libcore/run.rs
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 59f06feee4b..658fdec6df2 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -293,7 +293,13 @@ upcall_rust_personality(int version,
     s_rust_personality_args args = {(_Unwind_Reason_Code)0,
                                     version, actions, exception_class,
                                     ue_header, context};
-    rust_task *task = rust_get_current_task();
+    rust_task *task = rust_try_get_current_task();
+
+    if (task == NULL) {
+        // Assuming we're running with the new scheduler
+        upcall_s_rust_personality(&args);
+        return args.retval;
+    }
 
     // The personality function is run on the stack of the
     // last function that threw or landed, which is going
@@ -330,8 +336,12 @@ upcall_del_stack() {
 // needs to acquire the value of the stack pointer
 extern "C" CDECL void
 upcall_reset_stack_limit() {
-    rust_task *task = rust_get_current_task();
-    task->reset_stack_limit();
+    rust_task *task = rust_try_get_current_task();
+    if (task != NULL) {
+        task->reset_stack_limit();
+    } else {
+        // We must be in a newsched task
+    }
 }
 
 //