diff options
author | David Malcolm <dmalcolm@redhat.com> | 2016-12-15 18:05:05 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2016-12-15 18:05:05 +0000 |
commit | a3998c2fb1630638db83defcd2c680111d65b973 (patch) | |
tree | 6691b9007e679032843ddb4ba453fa49409bf3d2 /libcpp/ChangeLog | |
parent | a3038e190b271744d0b5e2e83d389864fed4d54e (diff) | |
download | gcc-a3998c2fb1630638db83defcd2c680111d65b973.zip gcc-a3998c2fb1630638db83defcd2c680111d65b973.tar.gz gcc-a3998c2fb1630638db83defcd2c680111d65b973.tar.bz2 |
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
Diffstat (limited to 'libcpp/ChangeLog')
-rw-r--r-- | libcpp/ChangeLog | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 6368122..ba90cfe 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,11 @@ +2016-12-15 David Malcolm <dmalcolm@redhat.com> + + 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. + 2016-12-12 David Malcolm <dmalcolm@redhat.com> PR preprocessor/78680 |