This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Avoid segfault if line_table->maps is not set up
- From: Tom Tromey <tromey at redhat dot com>
- To: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 26 Feb 2010 11:56:43 -0700
- Subject: Re: PATCH: Avoid segfault if line_table->maps is not set up
- References: <ydd8wairbd1.fsf@CeBiTec.Uni-Bielefeld.DE>
- Reply-to: tromey at redhat dot com
>>>>> "Rainer" == Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
Rainer> In ggc-common.c (gt_pch_restore), host_hooks.gt_pch_use_address
Rainer> returned with result < 0, and fatal_error ("had to relocate
Rainer> PCH") is called before line_table->maps has been set up, so
Rainer> set->maps is NULL in line-map.c (linemap_lookup). It seems very
Rainer> bad to segfault here instead of just returning, so I fixed this
Rainer> by returning a dummy line_map instead. Just returning NULL
Rainer> didn't work since too many places seem to assume that this
Rainer> cannot happen.
Restoring the PCH is such a special case that I think it should assume
responsibility for initializing the line map if it encounters a failure.
What do you think of that as an alternative?
Tom