From: Ivan Maidanski Date: Thu, 23 Mar 2017 00:16:12 +0000 (+0300) Subject: Fix tools/setjmp_t hang (OS X) X-Git-Tag: v7.4.6~142 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5eb7a201598978de232650bb3e6ddd6ded4c687e;p=gc Fix tools/setjmp_t hang (OS X) * tools/setjmp_t.c (main): Declare "y" static variable as volatile (to prevent reordering/optimization of y++). --- diff --git a/tools/setjmp_t.c b/tools/setjmp_t.c index 05798c26..0ed433d6 100644 --- a/tools/setjmp_t.c +++ b/tools/setjmp_t.c @@ -78,7 +78,7 @@ int main(void) unsigned ps = GETPAGESIZE(); jmp_buf b; register int x = (int)strlen("a"); /* 1, slightly disguised */ - static int y = 0; + static volatile int y = 0; sp = (word)(&sp); printf("This appears to be a %s running %s\n", MACH_TYPE, OS_TYPE);