From patchwork Sat Jul 10 11:41:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/4] Don't crash when there are no options in a LTO file Date: Sat, 10 Jul 2010 01:41:51 -0000 From: Andi Kleen X-Patchwork-Id: 58477 Message-Id: <20100710141.607682497@firstfloor.org> To: gcc-patches@gcc.gnu.org 2010-07-10 Andi Kleen * lto-opts.c (lto_read_file_options): Check for missing section. diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c index 8405714..fa52f95 100644 --- a/gcc/lto-opts.c +++ b/gcc/lto-opts.c @@ -356,6 +356,8 @@ lto_read_file_options (struct lto_file_decl_data *file_data) struct lto_input_block ib; data = lto_get_section_data (file_data, LTO_section_opts, NULL, &len); + if (!data) + return; header = (const struct lto_simple_header *) data; opts_offset = sizeof (*header);