File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -609,10 +609,21 @@ when unwinding through __morestack).
609
609
void
610
610
rust_task::reset_stack_limit () {
611
611
uintptr_t sp = get_sp ();
612
+ bool reseted = false ;
612
613
while (!sp_in_stk_seg (sp, stk)) {
614
+ reseted = true ;
613
615
prev_stack ();
614
616
assert (stk != NULL && " Failed to find the current stack" );
615
617
}
618
+
619
+ // Each call to prev_stack will record the stack limit. If we *didn't*
620
+ // call prev_stack then we still need to record it now to catch a corner case:
621
+ // the throw to initiate unwinding starts on the C stack while sp limit is 0.
622
+ // If we don't set the limit here then the rust code run subsequently will
623
+ // will veer into the red zone. Lame!
624
+ if (!reseted) {
625
+ record_stack_limit ();
626
+ }
616
627
}
617
628
618
629
void
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- // xfail-test
11
+ // xfail-fast
12
+
12
13
extern mod extra;
13
14
14
15
use std:: comm:: * ;
You can’t perform that action at this time.
0 commit comments