about summary refs log tree commit diff
path: root/src/rt/rust_kernel.cpp
diff options
context:
space:
mode:
authorBen Blum <bblum@andrew.cmu.edu>2012-06-28 19:01:55 -0400
committerBen Blum <bblum@andrew.cmu.edu>2012-06-28 19:02:48 -0400
commit6fc730baf6b3d156e7be7521cd60f352f2c0ea93 (patch)
treee472aa6ab0779ae281a50bbd05d8f86217f8bb67 /src/rt/rust_kernel.cpp
parentd91e3109824af5460bc2476bc6dbd74f8b0100d4 (diff)
downloadrust-6fc730baf6b3d156e7be7521cd60f352f2c0ea93.tar.gz
rust-6fc730baf6b3d156e7be7521cd60f352f2c0ea93.zip
Cleanup failure handling around rust_new_task_in_sched - closes #2668
Diffstat (limited to 'src/rt/rust_kernel.cpp')
-rw-r--r--src/rt/rust_kernel.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp
index b13b1490c0f..82fec98e86a 100644
--- a/src/rt/rust_kernel.cpp
+++ b/src/rt/rust_kernel.cpp
@@ -121,7 +121,9 @@ rust_kernel::get_scheduler_by_id(rust_sched_id id) {
 
 rust_scheduler *
 rust_kernel::get_scheduler_by_id_nolock(rust_sched_id id) {
-    assert(id != 0 && "invalid scheduler id");
+    if (id == 0) {
+        return NULL;
+    }
     sched_lock.must_have_lock();
     sched_map::iterator iter = sched_table.find(id);
     if (iter != sched_table.end()) {