about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorRon Dahlgren <ronald.dahlgren@gmail.com>2013-06-11 10:11:49 -0700
committerRon Dahlgren <ronald.dahlgren@gmail.com>2013-06-11 10:11:49 -0700
commit301f9001c01ffbca89241dcd8c0c2f1ae6928dfd (patch)
tree09be1d932d6396bc3fe365ab686048ea9f4bc70e /src/rt/rust_task.cpp
parent12203a76c22cebff394a2b157a0d1f4cec3d46f8 (diff)
downloadrust-301f9001c01ffbca89241dcd8c0c2f1ae6928dfd.tar.gz
rust-301f9001c01ffbca89241dcd8c0c2f1ae6928dfd.zip
Assert stk rather than checking null
Given that a big stack is never requested before allocating an initial
stack segment, having a non-null stk member here is an invariant.
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index c521feae72f..befcf149936 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -587,6 +587,7 @@ rust_task::cleanup_after_turn() {
 // stack and false otherwise.
 bool
 rust_task::new_big_stack() {
+		assert(stk);
     // If we have a cached big stack segment, use it.
     if (big_stack) {
         // Check to see if we're already on the big stack.
@@ -612,12 +613,11 @@ rust_task::new_big_stack() {
     }
 
     big_stack->task = this;
-    big_stack->next = stk ? stk->next : NULL;
+    big_stack->next = stk->next;
     if (big_stack->next)
         big_stack->next->prev = big_stack;
     big_stack->prev = stk;
-    if (stk)
-        stk->next = big_stack;
+		stk->next = big_stack;
 
     stk = big_stack;