summaryrefslogtreecommitdiff
path: root/os_dep.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-09-07 16:00:38 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-09-12 12:26:39 +0200
commiteb650a2a7697e7320ffadda1be064866a816349d (patch)
tree7b9811e6e8a4e84ea40fe5dba39173128d8a753e /os_dep.c
parent92198c76397bf78c59cd170315ad2c857c5be584 (diff)
HOTFIX: Always reset fault handler in GC_find_limit_with_bound on exit.
* 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).
Diffstat (limited to 'os_dep.c')
-rw-r--r--os_dep.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/os_dep.c b/os_dep.c
index 82223e9..0290e2e 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -939,10 +939,21 @@ GC_INNER word GC_page_size = 0;
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));
}
@@ -1356,7 +1367,7 @@ GC_INNER word GC_page_size = 0;
{
sb->mem_base = rtems_get_stack_bottom();
return GC_SUCCESS;
- }
+ }
# define HAVE_GET_STACK_BASE
#endif /* GC_RTEMS_PTHREADS */