diff mbox

[pph] Fix ICE with -fpph-hdr= (issue4316055)

Message ID 20110404115133.8FF3B1DA1BC@topo.tor.corp.google.com
State New
Headers show

Commit Message

Diego Novillo April 4, 2011, 11:51 a.m. UTC
We were not allocating memory for include_pph_mapping for -fpph-hdr=

2011-04-04  Diego Novillo  <dnovillo@google.com>

	* c-opts.c (add_pph_header_map): Create include_pph_mapping if it
	was NULL.


--
This patch is available for review at http://codereview.appspot.com/4316055
diff mbox

Patch

diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index c774dca..551db04 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -148,6 +148,9 @@  add_pph_header_map (const char *basename)
   char hdrbuf[MAXPATHLEN];
   char pphbuf[MAXPATHLEN];
 
+  if (include_pph_mapping == NULL)
+    include_pph_mapping = strstrmap_create ();
+
   length = strlen (basename);
   strcpy (hdrbuf, basename);
   strcpy (hdrbuf + length, ".h");