diff mbox

[1/4] Don't crash when there are no options in a LTO file

Message ID 20100710141.607682497@firstfloor.org
State New
Headers show

Commit Message

Andi Kleen July 10, 2010, 11:41 a.m. UTC
2010-07-10   Andi Kleen <ak@linux.intel.com>

	* lto-opts.c (lto_read_file_options): Check for missing section.
diff mbox

Patch

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);