~vcs-imports/eglibc/trunk

« back to all changes in this revision

Viewing changes to libc/nptl/tst-cleanup2.c

  • Committer: joseph
  • Date: 2013-09-05 22:41:05 UTC
  • Revision ID: svn-v4:7b3dc134-2b1b-0410-93df-9e9f96275f8d:trunk:23928
Merge changes between r23795 and r23927 from /fsf/trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
do_test (void)
35
35
{
36
36
  char *p = NULL;
 
37
  /* gcc can overwrite the success written value by scheduling instructions
 
38
     around sprintf.  It is allowed to do this since according to C99 the first
 
39
     argument of sprintf is a character array and NULL is not a valid character
 
40
     array.  Mark the return value as volatile so that it gets reloaded on
 
41
     return.  */
 
42
  volatile int ret = 0;
37
43
  struct sigaction sa;
38
44
 
39
45
  sa.sa_handler = sig_handler;
50
56
  if (setjmp (jmpbuf))
51
57
    {
52
58
      puts ("Exiting main...");
53
 
      return 0;
 
59
      return ret;
54
60
    }
55
61
 
56
62
  sprintf (p, "This should segv\n");