https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58893

Bernd Edlinger <bernd.edlinger at hotmail dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernd.edlinger at hotmail dot 
de

--- Comment #10 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
Created attachment 33546
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33546&action=edit
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?

Reply via email to