arrfab / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh884008.patch

147e83
diff --git glibc-2.17-c758a686/nptl/tst-cleanup2.c glibc-2.17-c758a686/nptl/tst-cleanup2.c
147e83
index 5bd1609..65af0f2 100644
147e83
--- glibc-2.17-c758a686/nptl/tst-cleanup2.c
147e83
+++ glibc-2.17-c758a686/nptl/tst-cleanup2.c
147e83
@@ -34,6 +34,12 @@ static int
147e83
 do_test (void)
147e83
 {
147e83
   char *p = NULL;
147e83
+  /* gcc can overwrite the success written value by scheduling instructions
147e83
+     around sprintf.  It is allowed to do this since according to C99 the first
147e83
+     argument of sprintf is a character array and NULL is not a valid character
147e83
+     array.  Mark the return value as volatile so that it gets reloaded on
147e83
+     return.  */
147e83
+  volatile int ret = 0;
147e83
   struct sigaction sa;
147e83
 
147e83
   sa.sa_handler = sig_handler;
147e83
@@ -50,7 +56,7 @@ do_test (void)
147e83
   if (setjmp (jmpbuf))
147e83
     {
147e83
       puts ("Exiting main...");
147e83
-      return 0;
147e83
+      return ret;
147e83
     }
147e83
 
147e83
   sprintf (p, "This should segv\n");