This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] [1/4] Don't crash when there are no options in a LTO file
- From: Andi Kleen <andi at firstfloor dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 10 Jul 2010 13:41:51 +0200 (CEST)
- Subject: [PATCH] [1/4] Don't crash when there are no options in a LTO file
2010-07-10 Andi Kleen <ak@linux.intel.com>
* 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);