File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,10 @@ template <class T>
17
17
stk_seg *
18
18
create_stack (T allocer, size_t sz) {
19
19
size_t total_sz = sizeof (stk_seg) + sz;
20
- return (stk_seg *)allocer->malloc (total_sz, " stack" );
20
+ stk_seg *stk = (stk_seg *)allocer->malloc (total_sz, " stack" );
21
+ memset (stk, 0 , sizeof (stk_seg));
22
+ stk->end = (uintptr_t ) &stk->data [sz];
23
+ return stk;
21
24
}
22
25
23
26
template <class T >
Original file line number Diff line number Diff line change @@ -584,11 +584,9 @@ rust_task::new_stack(size_t requested_sz) {
584
584
size_t sz = rust_stk_sz + RED_ZONE_SIZE;
585
585
stk_seg *new_stk = create_stack (this , sz);
586
586
LOGPTR (thread, " new stk" , (uintptr_t )new_stk);
587
- memset (new_stk, 0 , sizeof (stk_seg));
588
587
add_stack_canary (new_stk);
589
588
new_stk->prev = NULL ;
590
589
new_stk->next = stk;
591
- new_stk->end = (uintptr_t ) &new_stk->data [rust_stk_sz + RED_ZONE_SIZE];
592
590
LOGPTR (thread, " stk end" , new_stk->end );
593
591
594
592
stk = new_stk;
You can’t perform that action at this time.
0 commit comments