[PATCH] Fix segfault with -E -dU

Eric Botcazou ebotcazou@adacore.com
Tue Sep 23 09:04:00 GMT 2008


Hi,

when -E -dU is invoked on a builtin macro (e.g. __FILE__ or __STDC__ on 
Solaris), it first prints:

internal error: invalid hash type 1 in cpp_macro_definition

and then segfaults.  Fixed by the attached patchlet.

Tested on i586-suse-linux, OK for mainline?


2008-09-23  Eric Botcazou  <ebotcazou@adacore.com>

	* c-ppoutput.c (cb_used_define): Do nothing for a builtin node.


2008-09-23  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc.dg/cpp/cmdlne-dU-23.c: New test.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 438 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080923/cb0569f2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmdlne-dU-23.c
Type: text/x-csrc
Size: 143 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080923/cb0569f2/attachment-0001.bin>


More information about the Gcc-patches mailing list