about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-06-11 14:40:48 -0700
committerbors <bors@rust-lang.org>2013-06-11 14:40:48 -0700
commit1175e94de3b6d0f6b35fd8de3599b29267f1adab (patch)
tree07b04f457813630652485820bf7ba8e9e9f4109e /src
parentda9172af60e04d40aad2f0184e81e2a74916eeba (diff)
parent37c855889586754ddd2e19147a40c92450ddadec (diff)
downloadrust-1175e94de3b6d0f6b35fd8de3599b29267f1adab.tar.gz
rust-1175e94de3b6d0f6b35fd8de3599b29267f1adab.zip
auto merge of #7033 : influenza/rust/rust-7022, r=graydon
This commit fixes #7022 - I've added an additional check to ensure that
stk is not null before dereferencing it to get it's next element,
assigning NULL if it is itself NULL.
Diffstat (limited to 'src')
-rw-r--r--src/rt/rust_task.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index b5ecb166175..f9b588b7850 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.
@@ -616,8 +617,7 @@ rust_task::new_big_stack() {
     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;