Ticket #1380: x.c
File x.c, 317 bytes (added by , 7 years ago) |
---|
Line | |
---|---|
1 | #include <stdio.h> |
2 | #include <alloca.h> |
3 | #include <setjmp.h> |
4 | #include <string.h> |
5 | #include <stdlib.h> |
6 | |
7 | |
8 | jmp_buf jb; |
9 | |
10 | |
11 | int foo = 99; |
12 | int c = 0; |
13 | |
14 | |
15 | void bar() |
16 | { |
17 | c++; |
18 | longjmp(jb, 1); |
19 | } |
20 | |
21 | |
22 | int main() |
23 | { |
24 | setjmp(jb); |
25 | char *p = alloca(256); |
26 | memset(p, 0, 256); |
27 | printf("%d\n", foo); |
28 | |
29 | if(c < 10) bar(); |
30 | |
31 | exit(0); |
32 | } |