diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-04-29 18:28:01 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-04-30 17:01:27 -0700 |
| commit | 4a4646fd54a85f78512e5f2d1d2cd253954d1ea4 (patch) | |
| tree | 11e6e1bd26bf1cbdd278f30978fb632b0c74d7f7 /src/rt/rust_upcall.cpp | |
| parent | f1ddb8d5cc66941763039d3f727465b7cc34a100 (diff) | |
| parent | 6818e241b49c03c0fe0994dbe8340e2d8f482f09 (diff) | |
| download | rust-4a4646fd54a85f78512e5f2d1d2cd253954d1ea4.tar.gz rust-4a4646fd54a85f78512e5f2d1d2cd253954d1ea4.zip | |
Merge remote-tracking branch 'brson/io'
Conflicts: src/libcore/task/local_data_priv.rs
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 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 + } } // |
