2 /* A simple test to demonstrate heap, stack, and global overrun
10 __attribute__((noinline))
11 int addup_wrongly ( short* arr )
14 for (i = 0; i <= 100; i++)
19 __attribute__((noinline))
20 int do_other_stuff ( void )
23 return 123 + addup_wrongly(la);
26 __attribute__((noinline))
27 int do_stupid_malloc_stuff ( void )
30 unsigned char* duh = malloc(100 * sizeof(char));
39 long s = addup_wrongly(ga);
40 s += do_other_stuff();
41 s += do_stupid_malloc_stuff();
43 fprintf(stdout, "well, i never!\n");
45 fprintf(stdout, "boringly as expected\n");