[PATCH] Fix valgrind reported issue with diagnostics caret (PR c/69627)

David Malcolm dmalcolm@redhat.com
Wed Feb 3 20:27:00 GMT 2016

On Wed, 2016-02-03 at 21:07 +0100, Jakub Jelinek wrote:
> Hi!
> As range->m_caret.m_{line,column} is only initialized if
> range->m_show_caret_p is true, we really shouldn't be looking at
> those
> fields otherwise.
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
> ok for
> trunk?

I'm not a reviewer, but fwiw the change looks good to me; thanks.

[the uninitialized data is coming from:
gcc_rich_location::add_expr, which leaves m_show_caret_p as false, and
doesn't bother initializing m_caret].

More information about the Gcc-patches mailing list