Debian Codegraph @

tests/2585.gvpr

raw
1 BEGIN {
2 string action = ARGC == 0 ? "no-crash" : ARGV[0];
3
4 /*
5 Start of code that should be rejected before execution
6 of gvpr program.
7 */
8
9 void void1;
10
11 void void_array1[void];
12 void void_array2[];
13
14 void void2;
15 void void3;
16 void void4;
17 void4 = void2 + void3;
18
19 void f1(void x) {}
20
21 void f2(void x) {
22 print("Rhubarb.");
23 }
24
25 void void5;
26 int i = 10;
27 void5 = i;
28
29 /*
30 End of code that should be rejected before execution
31 of gvpr program.
32 */
33
34 switch (action) {
35 case "crash1":
36 print(void1); // segfault
37 break;
38 case "crash2":
39 print(void4); // segfault
40 break;
41 case "crash3":
42 print(void5); // segfault
43 break;
44 case "crash4":
45 void_array2[void1] = void1; // segfault
46 break;
47 case "crash5":
48 f1(void_array2[void1]); // segfault
49 break;
50 case "crash6":
51 f1(); // segfault
52 break;
53 case "no-crash":
54 f2();
55 print("No crash.");
56 }
57 }