gcc/libcpp
David Malcolm a3998c2fb1 Fix use-after-free lexing unterminated raw strings (PR preprocessor/78811)
gcc/ChangeLog:
	PR preprocessor/78680
	PR preprocessor/78811
	* input.c (struct selftest::lexer_test): Add field
	m_implicitly_expect_EOF.
	(selftest::lexer_error_sink): New class.
	(selftest::lexer_error_sink::s_singleton): New global.
	(selftest::lexer_test::lexer_test): Initialize new field
	"m_implicitly_expect_EOF".
	(selftest::lexer_test::~lexer_test): Conditionalize the
	check for the EOF token on the new field.
	(selftest::test_lexer_string_locations_raw_string_unterminated):
	New function.
	(selftest::input_c_tests): Call the new test.

libcpp/ChangeLog:
	PR preprocessor/78680
	PR preprocessor/78811
	* lex.c (_cpp_lex_direct): Only determine the end-location of
	the token and build a range for non-reserved start locations.
	Do not do it for EOF tokens.

From-SVN: r243721
2016-12-15 18:05:05 +00:00
..
include system.h (HAVE_DESIGNATED_INITIALIZERS, [...]): Do not use "defined" in macros. 2016-11-23 10:06:07 +00:00
po
aclocal.m4
ChangeLog Fix use-after-free lexing unterminated raw strings (PR preprocessor/78811) 2016-12-15 18:05:05 +00:00
ChangeLog.jit
charset.c Fix locations within raw strings 2016-11-17 15:55:26 +00:00
config.in
configure
configure.ac
directives-only.c
directives.c
errors.c
expr.c system.h (HAVE_DESIGNATED_INITIALIZERS, [...]): Do not use "defined" in macros. 2016-11-23 10:06:07 +00:00
files.c
identifiers.c
init.c
internal.h
lex.c Fix use-after-free lexing unterminated raw strings (PR preprocessor/78811) 2016-12-15 18:05:05 +00:00
line-map.c
location-example.txt
macro.c
Makefile.in
makeucnid.c
mkdeps.c
pch.c
symtab.c
system.h system.h (HAVE_DESIGNATED_INITIALIZERS, [...]): Do not use "defined" in macros. 2016-11-23 10:06:07 +00:00
traditional.c
ucnid.h
ucnid.tab