mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	cont.c (rb_fiber_atfork): th->root_fiber may not exist
Otherwise, bootstraptest/test_fork.rb fails with -DVM_CHECK_MODE=2 [Bug #15041] Fixes: r64589 "cont.c: set th->root_fiber to current fiber at fork" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									3bcb4ff810
								
							
						
					
					
						commit
						13f4923551
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		
							
								
								
									
										10
									
								
								cont.c
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								cont.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1981,11 +1981,13 @@ fiber_to_s(VALUE fibval)
 | 
			
		|||
void
 | 
			
		||||
rb_fiber_atfork(rb_thread_t *th)
 | 
			
		||||
{
 | 
			
		||||
    if (&th->root_fiber->cont.saved_ec != th->ec) {
 | 
			
		||||
        th->root_fiber = th->ec->fiber_ptr;
 | 
			
		||||
        th->root_fiber->cont.type = ROOT_FIBER_CONTEXT;
 | 
			
		||||
    if (th->root_fiber) {
 | 
			
		||||
        if (&th->root_fiber->cont.saved_ec != th->ec) {
 | 
			
		||||
            th->root_fiber = th->ec->fiber_ptr;
 | 
			
		||||
            th->root_fiber->cont.type = ROOT_FIBER_CONTEXT;
 | 
			
		||||
        }
 | 
			
		||||
        th->root_fiber->prev = 0;
 | 
			
		||||
    }
 | 
			
		||||
    th->root_fiber->prev = 0;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue