https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58893
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |trippels at gcc dot gnu.org
--- Comment #11 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Bernd Edlinger from comment #10)
> Created attachment 33546 [details]
> possible fix
>
> Hi,
>
> I have looked at this issue, and think this is the right fix.
>
> Regarding the hunk in cpp_diagnostic, which is not directly involved
> in this bug, but still obviously wrong:
>
> The line "src_loc = pfile->cur_run->prev->limit->src_loc"
> is probably unreachable, but will crash it is ever executed.
>
> see:
>
> _cpp_init_tokenrun (tokenrun *run, unsigned int count)
> {
> run->base = XNEWVEC (cpp_token, count);
> run->limit = run->base + count;
> run->next = NULL;
> }
>
> limit points at the end of the run, prev is uninitialized.
>
> Comments?
Looks good to me, but please post it to the gcc-patches mailing list.