Skip to content

Commit

Permalink
auto merge of #7033 : influenza/rust/rust-7022, r=graydon
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Jun 11, 2013
2 parents da9172a + 37c8558 commit 1175e94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rt/rust_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 1175e94

Please sign in to comment.