gcc/libcpp
David Malcolm 6df8934f6a Reject fix-it hints for various awkward boundary cases (PR c/82050)
PR c/82050 reports a failed assertion deep within diagnostic_show_locus's
code for printing fix-it hints.

The root cause is a fix-it hint suggesting a textual replacement,
where the affected column numbers straddle the LINE_MAP_MAX_COLUMN_NUMBER
boundary, so that the start of the range has a column number, but the
end of the range doesn't.

The fix is to verify that the column numbers are sane when adding fix-it
hints to a rich_location, rejecting fix-it hints where they are not.

libcpp/ChangeLog:
	PR c/82050
	* include/line-map.h (LINE_MAP_MAX_COLUMN_NUMBER): Move here.
	* line-map.c (LINE_MAP_MAX_COLUMN_NUMBER): ...from here.
	(rich_location::maybe_add_fixit): Reject fix-it hints in which
	the start column exceeds the next column.

From-SVN: r255214
2017-11-28 19:24:35 +00:00
..
include Reject fix-it hints for various awkward boundary cases (PR c/82050) 2017-11-28 19:24:35 +00:00
po Regenerate .pot files. 2017-08-04 23:21:23 +01:00
aclocal.m4
ChangeLog Reject fix-it hints for various awkward boundary cases (PR c/82050) 2017-11-28 19:24:35 +00:00
ChangeLog.jit
charset.c Update copyright years. 2017-01-01 13:07:43 +01:00
config.in re PR bootstrap/72823 (r239175 causes build failure) 2016-11-16 21:10:27 +01:00
configure re PR bootstrap/72823 (r239175 causes build failure) 2016-11-16 21:10:27 +01:00
configure.ac re PR bootstrap/72823 (r239175 causes build failure) 2016-11-16 21:10:27 +01:00
directives-only.c Update copyright years. 2017-01-01 13:07:43 +01:00
directives.c diagnostics: get rid of *_at_rich_loc in favor of overloading 2017-10-31 20:21:58 +00:00
errors.c diagnostics: get rid of *_at_rich_loc in favor of overloading 2017-10-31 20:21:58 +00:00
expr.c invoke.texi: Document -std=c++17 and -std=gnu++17 and document c++1z and gnu++1z as deprecated. 2017-09-15 18:15:46 +02:00
files.c Update copyright years. 2017-01-01 13:07:43 +01:00
identifiers.c Implement __VA_OPT__ 2017-11-13 20:17:42 +00:00
init.c Implement __VA_OPT__ 2017-11-13 20:17:42 +00:00
internal.h Implement __VA_OPT__ 2017-11-13 20:17:42 +00:00
lex.c Implement __VA_OPT__ 2017-11-13 20:17:42 +00:00
line-map.c Reject fix-it hints for various awkward boundary cases (PR c/82050) 2017-11-28 19:24:35 +00:00
location-example.txt
macro.c Use -Wtraditional for "would be stringified in traditional C" (PR preprocessor/81794) 2017-11-21 00:57:29 +00:00
Makefile.in * Makefile.in (po/$(PACKAGE).pot): Adjust bug reporting URL. 2017-02-09 08:55:46 +00:00
makeucnid.c Update copyright years. 2017-01-01 13:07:43 +01:00
mkdeps.c Update copyright years. 2017-01-01 13:07:43 +01:00
pch.c Implement __VA_OPT__ 2017-11-13 20:17:42 +00:00
symtab.c Update copyright years. 2017-01-01 13:07:43 +01:00
system.h Update copyright years. 2017-01-01 13:07:43 +01:00
traditional.c Update copyright years. 2017-01-01 13:07:43 +01:00
ucnid.h Update copyright years. 2017-01-01 13:07:43 +01:00
ucnid.tab Update copyright years. 2017-01-01 13:07:43 +01:00