Commit 83eb5a03 by David Malcolm Committed by David Malcolm

PR diagnostic/68899: fix read-beyond-buffer when printing very wide source lines

gcc/ChangeLog:
	PR diagnostic/68899
	* diagnostic-show-locus.c (layout::print_source_line): Move x
	offset of line until after call to
	get_line_width_without_trailing_whitespace.

From-SVN: r232465
parent ec7886c1
2016-01-15 David Malcolm <dmalcolm@redhat.com>
PR diagnostic/68899
* diagnostic-show-locus.c (layout::print_source_line): Move x
offset of line until after call to
get_line_width_without_trailing_whitespace.
2016-01-15 Jeff Law <law@redhat.com> 2016-01-15 Jeff Law <law@redhat.com>
PR tree-optimization/69270 PR tree-optimization/69270
......
...@@ -524,14 +524,13 @@ layout::print_source_line (int row, line_bounds *lbounds_out) ...@@ -524,14 +524,13 @@ layout::print_source_line (int row, line_bounds *lbounds_out)
if (!line) if (!line)
return false; return false;
line += m_x_offset;
m_colorizer.set_normal_text (); m_colorizer.set_normal_text ();
/* We will stop printing the source line at any trailing /* We will stop printing the source line at any trailing
whitespace. */ whitespace. */
line_width = get_line_width_without_trailing_whitespace (line, line_width = get_line_width_without_trailing_whitespace (line,
line_width); line_width);
line += m_x_offset;
pp_space (m_pp); pp_space (m_pp);
int first_non_ws = INT_MAX; int first_non_ws = INT_MAX;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment