Skip to content

Commit 1175e94

Browse files
committed
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.
2 parents da9172a + 37c8558 commit 1175e94

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rt/rust_task.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@ rust_task::cleanup_after_turn() {
587587
// stack and false otherwise.
588588
bool
589589
rust_task::new_big_stack() {
590+
assert(stk);
590591
// If we have a cached big stack segment, use it.
591592
if (big_stack) {
592593
// Check to see if we're already on the big stack.
@@ -616,8 +617,7 @@ rust_task::new_big_stack() {
616617
if (big_stack->next)
617618
big_stack->next->prev = big_stack;
618619
big_stack->prev = stk;
619-
if (stk)
620-
stk->next = big_stack;
620+
stk->next = big_stack;
621621

622622
stk = big_stack;
623623

0 commit comments

Comments
 (0)