mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* gc.c (GET_STACK_BOUNDS): fixed macro argument names. a patch from
Satoshi Shiba <shiba AT rvm.jp> at [ruby-dev:40973]. * gc.h (ruby_get_stack_grow_direction): fixed prototype. * thread_pthread.c (get_stack, ruby_stack_overflowed_p): both side should be same type. [Bug #3145] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									92496d73eb
								
							
						
					
					
						commit
						95c52c8e6c
					
				
					 4 changed files with 14 additions and 4 deletions
				
			
		
							
								
								
									
										10
									
								
								ChangeLog
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								ChangeLog
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,3 +1,13 @@
 | 
			
		|||
Wed Apr 14 16:29:02 2010  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* gc.c (GET_STACK_BOUNDS): fixed macro argument names.  a patch from
 | 
			
		||||
	  Satoshi Shiba <shiba AT rvm.jp> at [ruby-dev:40973].
 | 
			
		||||
 | 
			
		||||
	* gc.h (ruby_get_stack_grow_direction): fixed prototype.
 | 
			
		||||
 | 
			
		||||
	* thread_pthread.c (get_stack, ruby_stack_overflowed_p): both side
 | 
			
		||||
	  should be same type.  [Bug #3145]
 | 
			
		||||
 | 
			
		||||
Wed Apr 14 15:58:11 2010  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* string.c (rb_string_value_cstr): make NUL terminated if it is
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								gc.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								gc.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -2099,7 +2099,7 @@ void rb_vm_mark(void *ptr);
 | 
			
		|||
#elif STACK_GROW_DIRECTION > 0
 | 
			
		||||
#define GET_STACK_BOUNDS(start, end, appendix) (start = STACK_START, end = STACK_END+appendix)
 | 
			
		||||
#else
 | 
			
		||||
#define GET_STACK_BOUNDS(stack_start, stack_end, appendix) \
 | 
			
		||||
#define GET_STACK_BOUNDS(start, end, appendix) \
 | 
			
		||||
    ((STACK_END < STACK_START) ? \
 | 
			
		||||
     (start = STACK_END, end = STACK_START) : (start = STACK_START, end = STACK_END+appendix))
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								gc.h
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								gc.h
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -66,7 +66,7 @@ rb_gc_debug_body(const char *mode, const char *msg, int st, void *ptr)
 | 
			
		|||
# define STACK_UPPER(x, a, b) b
 | 
			
		||||
#else
 | 
			
		||||
RUBY_EXTERN int ruby_stack_grow_direction;
 | 
			
		||||
int ruby_get_stack_grow_direction(VALUE *addr);
 | 
			
		||||
int ruby_get_stack_grow_direction(volatile VALUE *addr);
 | 
			
		||||
# define stack_growup_p(x) (			\
 | 
			
		||||
	(ruby_stack_grow_direction ?		\
 | 
			
		||||
	 ruby_stack_grow_direction :		\
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -221,7 +221,7 @@ get_stack(void **addr, size_t *size)
 | 
			
		|||
#   endif
 | 
			
		||||
    if (pthread_attr_getguardsize(&attr, &guard) == 0) {
 | 
			
		||||
	STACK_GROW_DIR_DETECTION;
 | 
			
		||||
	STACK_DIR_UPPER((void)0, *addr = (char *)*addr + guard);
 | 
			
		||||
	STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + guard));
 | 
			
		||||
	*size -= guard;
 | 
			
		||||
    }
 | 
			
		||||
# else
 | 
			
		||||
| 
						 | 
				
			
			@ -850,7 +850,7 @@ ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr)
 | 
			
		|||
    }
 | 
			
		||||
#ifdef STACKADDR_AVAILABLE
 | 
			
		||||
    else if (get_stack(&base, &size) == 0) {
 | 
			
		||||
	STACK_DIR_UPPER(base = (char *)base + size, (void)0);
 | 
			
		||||
	STACK_DIR_UPPER((void)(base = (char *)base + size), (void)0);
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
    else {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue