Skip to content

Commit

Permalink
* gc.c (GET_STACK_BOUNDS): fixed macro argument names. a patch from
Browse files Browse the repository at this point in the history
  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 ruby#3145]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Apr 14, 2010
1 parent 92496d7 commit 95c52c8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
Wed Apr 14 16:29:02 2010 Nobuyoshi Nakada <[email protected]>

* 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 <[email protected]>

* string.c (rb_string_value_cstr): make NUL terminated if it is
Expand Down
2 changes: 1 addition & 1 deletion gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 : \
Expand Down
4 changes: 2 additions & 2 deletions thread_pthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 95c52c8

Please sign in to comment.