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.
This commit is contained in:
bors 2013-06-11 14:40:48 -07:00
commit 1175e94de3
1 changed files with 2 additions and 2 deletions

View File

@ -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;