Skip to content

Commit 352c5e7

Browse files
committed
auto merge of rust-lang#12908 : alexcrichton/rust/issue-12897, r=thestinger
This is mostly just an implementation detail, and anyone worried about the stack bounds doesn't need to be bothered with the red zone because it's not usable anyway. Closes rust-lang#12897
2 parents 1d828eb + bf67783 commit 352c5e7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/libgreen/task.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020
2121
use std::any::Any;
2222
use std::cast;
23-
use std::rt::env;
23+
use std::raw;
2424
use std::rt::Runtime;
25+
use std::rt::env;
2526
use std::rt::local::Local;
2627
use std::rt::rtio;
28+
use std::rt::stack;
2729
use std::rt::task::{Task, BlockedTask, SendMessage};
2830
use std::task::TaskOpts;
2931
use std::unstable::mutex::NativeMutex;
30-
use std::raw;
3132

3233
use context::Context;
3334
use coroutine::Coroutine;
@@ -469,7 +470,9 @@ impl Runtime for GreenTask {
469470
let c = self.coroutine.as_ref()
470471
.expect("GreenTask.stack_bounds called without a coroutine");
471472

472-
(c.current_stack_segment.start() as uint,
473+
// Don't return the red zone as part of the usable stack of this task,
474+
// it's essentially an implementation detail.
475+
(c.current_stack_segment.start() as uint + stack::RED_ZONE,
473476
c.current_stack_segment.end() as uint)
474477
}
475478

0 commit comments

Comments
 (0)