re PR driver/43335 (Driver crashes dereferencing a null pointer if it can't find lto-wrapper)

2010-11-22  Dmitry Gorbachev  <d.g.gorbachev@gmail.com>

	PR driver/43335
	* gcc.c (main): Don't crash when lto-wrapper program is not found.

From-SVN: r167052
This commit is contained in:
Dmitry Gorbachev 2010-11-22 21:18:15 +00:00 committed by Joseph Myers
parent 2d171cfe1f
commit de9a793edf
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2010-11-22 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
PR driver/43335
* gcc.c (main): Don't crash when lto-wrapper program is not found.
2010-11-22 Joern Rennecke <amylaar@spamcop.net>
PR target/46608

View File

@ -6074,6 +6074,7 @@ main (int argc, char **argv)
int num_linker_inputs = 0;
char *explicit_link_files;
char *specs_file;
char *lto_wrapper_file;
const char *p;
struct user_specs *uptr;
char **old_argv = argv;
@ -6412,9 +6413,10 @@ main (int argc, char **argv)
/* Set up to remember the pathname of the lto wrapper. */
lto_wrapper_spec = find_a_file (&exec_prefixes, "lto-wrapper", X_OK, false);
if (lto_wrapper_spec)
lto_wrapper_file = find_a_file (&exec_prefixes, "lto-wrapper", X_OK, false);
if (lto_wrapper_file)
{
lto_wrapper_spec = lto_wrapper_file;
obstack_init (&collect_obstack);
obstack_grow (&collect_obstack, "COLLECT_LTO_WRAPPER=",
sizeof ("COLLECT_LTO_WRAPPER=") - 1);