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]

Re: PATCH: Avoid segfault if line_table->maps is not set up


>>>>> "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


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