diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-04-22 17:15:31 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-04-22 17:15:31 -0700 |
| commit | 42c0f88232847e97e6cf3578ef197d1942bba44d (patch) | |
| tree | 6167cb170f891dad4674e2c186f785d6a0160b5d /src/rt/rust_upcall.cpp | |
| parent | 5fbb0949a53a6ac51c6d9b187ef4c464e52ae536 (diff) | |
| download | rust-42c0f88232847e97e6cf3578ef197d1942bba44d.tar.gz rust-42c0f88232847e97e6cf3578ef197d1942bba44d.zip | |
core::rt: Add unwinding to newsched tasks
Diffstat (limited to 'src/rt/rust_upcall.cpp')
| -rw-r--r-- | src/rt/rust_upcall.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 9f39e1433fc..34236c36c14 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -272,7 +272,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 @@ -309,8 +315,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 + } } // |
