summaryrefslogtreecommitdiff
path: root/darwin_stop_world.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2016-12-07 11:02:59 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-12-07 11:02:59 +0300
commit2550e0778d60b8b4f595dacd0b2b4dc6f3ea9fa1 (patch)
tree6234be5ea98b7e017d33bb67f9cb467599993677 /darwin_stop_world.c
parentb88b91895413255ec8e4fe46db7261c7978a6ed0 (diff)
downloadbdwgc-2550e0778d60b8b4f595dacd0b2b4dc6f3ea9fa1.tar.gz
Fix 'bogus LR' detection in FindTopOfStack (Darwin)
(fix commit 5742f86) * darwin_stop_world.c [!DARWIN_DONT_PARSE_STACK] (GC_FindTopOfStack): Use "UL" suffix (instead of "U") for 0x3 (on the right side of the comparison) to avoid implicit unsigned int-to-long value extension of "~" operator result.
Diffstat (limited to 'darwin_stop_world.c')
-rw-r--r--darwin_stop_world.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/darwin_stop_world.c b/darwin_stop_world.c
index 7cd5775f..37aee97d 100644
--- a/darwin_stop_world.c
+++ b/darwin_stop_world.c
@@ -83,7 +83,7 @@ GC_INNER ptr_t GC_FindTopOfStack(unsigned long stack_start)
/* we do these next two checks after going to the next frame
because the LR for the first stack frame in the loop
is not set up on purpose, so we shouldn't check it. */
- if ((frame->savedLR & ~0x3) == 0 || (frame->savedLR & ~0x3) == ~0x3U)
+ if ((frame->savedLR & ~0x3) == 0 || (frame->savedLR & ~0x3) == ~0x3UL)
break; /* if the next LR is bogus, stop */
}
# ifdef DEBUG_THREADS_EXTRA