This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]