mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Tue Mar 12 04:57:57 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* setjmp/Makefile (tests): Add jmpbug. * setjmp/jmpbug.c: New file.
This commit is contained in:
32
setjmp/jmpbug.c
Normal file
32
setjmp/jmpbug.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/* setjmp vs alloca test case. Exercised bug on sparc. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <setjmp.h>
|
||||
#include <alloca.h>
|
||||
|
||||
void
|
||||
sub5 (jmp_buf buf)
|
||||
{
|
||||
longjmp (buf, 1);
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
jmp_buf buf;
|
||||
char *foo;
|
||||
int arr[100];
|
||||
|
||||
arr[77] = 76;
|
||||
if (setjmp (buf))
|
||||
{
|
||||
printf ("made it ok; %d\n", arr[77]);
|
||||
exit (0);
|
||||
}
|
||||
|
||||
foo = (char *) alloca (128);
|
||||
sub5 (buf);
|
||||
|
||||
/* NOTREACHED */
|
||||
return 1;
|
||||
}
|
Reference in New Issue
Block a user