* os_dep.c (GC_find_limit_with_bound): Inside loop, set result local
volatile variable and do break instead of return (this also suppresses
compiler warning about the potential clobbering of "bound" variable
by setjmp).
for (;;) {
if (up) {
result += MIN_PAGE_SIZE;
- if (result >= bound) return bound;
+ if (result >= bound) {
+ result = bound;
+ break;
+ }
} else {
result -= MIN_PAGE_SIZE;
- if (result <= bound) return bound;
+ if (result <= bound) {
+ result = bound - MIN_PAGE_SIZE;
+ /* This is to compensate */
+ /* further result increment (we */
+ /* do not modify "up" variable */
+ /* since it might be clobbered */
+ /* by setjmp otherwise). */
+ break;
+ }
}
GC_noop1((word)(*result));
}
{
sb->mem_base = rtems_get_stack_bottom();
return GC_SUCCESS;
- }
+ }
# define HAVE_GET_STACK_BASE
#endif /* GC_RTEMS_PTHREADS */