@@ -363,28 +363,18 @@ rust_task::return_c_stack() {
363
363
// NB: This runs on the Rust stack
364
364
inline void *
365
365
rust_task::next_stack (size_t stk_sz, void *args_addr, size_t args_sz) {
366
- stk_seg *maybe_next_stack = NULL ;
367
- if (stk != NULL ) {
368
- maybe_next_stack = stk->prev ;
369
- }
370
-
371
366
new_stack_fast (stk_sz + args_sz);
372
367
A (thread, stk->end - (uintptr_t )stk->data >= stk_sz + args_sz,
373
368
" Did not receive enough stack" );
374
369
uint8_t *new_sp = (uint8_t *)stk->end ;
375
370
// Push the function arguments to the new stack
376
371
new_sp = align_down (new_sp - args_sz);
377
372
378
- // When reusing a stack segment we need to tell valgrind that this area of
379
- // memory is accessible before writing to it, because the act of popping
380
- // the stack previously made all of the stack inaccessible.
381
- if (maybe_next_stack == stk) {
382
- // I don't know exactly where the region ends that valgrind needs us
383
- // to mark accessible. On x86_64 these extra bytes aren't needed, but
384
- // on i386 we get errors without.
385
- int fudge_bytes = 16 ;
386
- reuse_valgrind_stack (stk, new_sp - fudge_bytes);
387
- }
373
+ // I don't know exactly where the region ends that valgrind needs us
374
+ // to mark accessible. On x86_64 these extra bytes aren't needed, but
375
+ // on i386 we get errors without.
376
+ const int fudge_bytes = 16 ;
377
+ reuse_valgrind_stack (stk, new_sp - fudge_bytes);
388
378
389
379
memcpy (new_sp, args_addr, args_sz);
390
380
record_stack_limit ();
0 commit comments