From: Manuel Mohr Date: Wed, 7 Dec 2011 16:30:29 +0000 (+0100) Subject: Prevent segfault with -bprofilegenerate=true for empty input files. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=65261e15cb91c3726def43e5fc12360a85779de1;p=libfirm Prevent segfault with -bprofilegenerate=true for empty input files. --- diff --git a/ir/be/bemain.c b/ir/be/bemain.c index cd01bca57..45917af41 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -557,7 +557,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name) prof_filename); } } - if (be_options.opt_profile_generate) { + if (num_birgs > 0 && be_options.opt_profile_generate) { ir_graph *prof_init_irg = ir_profile_instrument(prof_filename); initialize_birg(&birgs[num_birgs], prof_init_irg, &env);