Further harden glibc malloc metadata against 1-byte overflows.
[glibc.git] / setjmp / jmpbug.c
blob8594c5a8a782b2182d0e8e39a58c4a2f08ebeec8
1 /* setjmp vs alloca test case. Exercised bug on sparc. */
3 #include <stdio.h>
4 #include <setjmp.h>
5 #include <alloca.h>
7 static void
8 sub5 (jmp_buf buf)
10 longjmp (buf, 1);
13 static void
14 test (int x)
16 jmp_buf buf;
17 char *volatile foo;
18 int arr[100];
20 arr[77] = x;
21 if (setjmp (buf))
23 printf ("made it ok; %d\n", arr[77]);
24 return;
27 foo = (char *) alloca (128);
28 (void) foo;
29 sub5 (buf);
32 int
33 main (void)
35 int i;
37 for (i = 123; i < 345; ++i)
38 test (i);
40 return 0;