Prevent ICEs due to bogus substring locations (PR preprocessor/79210)
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 31 Jan 2017 20:22:43 +0000 (20:22 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 31 Jan 2017 20:22:43 +0000 (20:22 +0000)
commit7cfa044d991a2622ca82c92b042ca06824994acd
tree08067378539cdf2cf09a589aa4ac65142975bfdb
parent5ae37bdfce3f433ff51af4d614d9271abb25671f
Prevent ICEs due to bogus substring locations (PR preprocessor/79210)

gcc/ChangeLog:
PR preprocessor/79210
* input.c (get_substring_ranges_for_loc): Replace line_width
assertion with error-handling.

gcc/testsuite/ChangeLog:
PR preprocessor/79210
* gcc.dg/format/pr79210.c: New test case.
* gcc.dg/plugin/diagnostic-test-string-literals-2.c (test_pr79210):
New function.

From-SVN: r245070
gcc/ChangeLog
gcc/input.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/format/pr79210.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-2.c