From 65261e15cb91c3726def43e5fc12360a85779de1 Mon Sep 17 00:00:00 2001 From: Manuel Mohr Date: Wed, 7 Dec 2011 17:30:29 +0100 Subject: [PATCH] Prevent segfault with -bprofilegenerate=true for empty input files. --- ir/be/bemain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.20.1