4
4
#include < cstdio>
5
5
#include < csignal>
6
6
7
- char * me = NULL ; // The name of this executable -- captured at the top of main()
8
-
9
7
void on_segfault (int signal, siginfo_t * info, void * arg) {
10
8
fprintf (stderr, " Segmentation fault at %p\n " , info->si_addr );
11
9
DBG (" Segmentation fault at %p" , info->si_addr );
@@ -20,20 +18,19 @@ void start_catch_segfault() {
20
18
sigaction (SIGSEGV, &x, NULL );
21
19
}
22
20
23
- int main (int argc, char ** argv) {
24
- if (argc > 0 ) me = argv[0 ];
21
+ int main () {
25
22
start_catch_segfault ();
26
23
pickle::pickle vm;
27
- vm.push_instruction (vm.make_symbol (" foo" ));
28
- vm.push_instruction (vm.make_symbol (" bar" ), vm.make_symbol (" error" ));
29
- vm.push_instruction (vm.make_symbol (" baz" ));
30
- vm.push_instruction (vm.make_symbol (" baz" ), vm.make_symbol (" test long symbol with spaces" ));
31
- vm.push_instruction (vm.make_symbol (" baz" ));
32
- vm.push_instruction (vm.make_symbol (" baz" ));
33
- vm.push_instruction (vm.make_symbol (" baz" ));
24
+ for (size_t i = 0 ; i < 100 ; i++) {
25
+ vm.push_instruction (vm.make_symbol (" foo" ));
26
+ vm.push_instruction (vm.make_symbol (" bar" ), vm.make_symbol (" error" ));
27
+ vm.push_instruction (vm.make_symbol (" baz" ));
28
+ vm.push_instruction (vm.make_symbol (" baz" ), vm.make_symbol (" test long symbol with spaces" ));
29
+ vm.push_instruction (vm.make_symbol (" baz" ));
30
+ vm.push_instruction (vm.make_symbol (" baz" ));
31
+ }
34
32
pickle::dump (vm.instruction_stack );
35
33
putchar (' \n ' );
36
-
37
34
vm.gc ();
38
35
printf (" all done -- cleaning up\n " );
39
36
return 0 ;
0 commit comments