From 21e06fedebb86968f822ca75121eb2fba3467b83 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 7 Dec 2016 11:02:59 +0300 Subject: [PATCH] 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. --- darwin_stop_world.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwin_stop_world.c b/darwin_stop_world.c index 5887e7ba..be9f43f7 100644 --- a/darwin_stop_world.c +++ b/darwin_stop_world.c @@ -79,7 +79,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 -- 2.50.1