mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
avoid false positive on fiber_verify().
* cont.c (fiber_store): move `cont_save_machine_stack()` timing to avoid `fiber_verify()` false positive on `FIBER_USE_NATIVE == 0` and `GC.stress = true`. This patch is very dirty and it should be removed soon. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
525532ff43
commit
2a01ac897d
1 changed files with 6 additions and 1 deletions
7
cont.c
7
cont.c
|
@ -1444,6 +1444,12 @@ fiber_store(rb_fiber_t *next_fib, rb_thread_t *th)
|
|||
#endif
|
||||
|
||||
if (FIBER_RESUMED_P(fib)) fiber_status_set(fib, FIBER_SUSPENDED);
|
||||
|
||||
#if FIBER_USE_NATIVE == 0
|
||||
/* should (re-)allocate stack are before fib->status change to pass fiber_verify() */
|
||||
cont_save_machine_stack(th, &fib->cont);
|
||||
#endif
|
||||
|
||||
fiber_status_set(next_fib, FIBER_RESUMED);
|
||||
|
||||
#if FIBER_USE_NATIVE
|
||||
|
@ -1473,7 +1479,6 @@ fiber_store(rb_fiber_t *next_fib, rb_thread_t *th)
|
|||
return fib->cont.value;
|
||||
|
||||
#else /* FIBER_USE_NATIVE */
|
||||
cont_save_machine_stack(th, &fib->cont);
|
||||
if (ruby_setjmp(fib->cont.jmpbuf)) {
|
||||
/* restored */
|
||||
fib = th->ec.fiber;
|
||||
|
|
Loading…
Reference in a new issue