aboutsummaryrefslogtreecommitdiff
path: root/libcpp/lex.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-07-28 15:40:15 +0200
committerJakub Jelinek <jakub@redhat.com>2020-07-28 15:40:15 +0200
commitae49af94850b26e50268031e24f1559d5a51edec (patch)
tree3a3cd4dfb6f1fb0ad0900bdaf8afa6196f844143 /libcpp/lex.c
parent862a58ed83c681efd2724db2b71294fc71196b73 (diff)
downloadgcc-ae49af94850b26e50268031e24f1559d5a51edec.zip
gcc-ae49af94850b26e50268031e24f1559d5a51edec.tar.gz
gcc-ae49af94850b26e50268031e24f1559d5a51edec.tar.bz2
libcpp: Fix up raw string literal parsing error-recovery [PR96323]
For (invalid) newline inside of the raw string literal delimiter, doing continue means we skip the needed processing of newlines. Instead of duplicating that, this patch just doesn't continue for those. 2020-07-28 Jakub Jelinek <jakub@redhat.com> PR preprocessor/96323 * lex.c (lex_raw_string): For c == '\n' don't continue after reporting an prefix delimiter error. * c-c++-common/cpp/pr96323.c: New test.
Diffstat (limited to 'libcpp/lex.c')
-rw-r--r--libcpp/lex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libcpp/lex.c b/libcpp/lex.c
index 5d94882..9aec9e0 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -1885,7 +1885,8 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base)
the best failure mode. */
prefix_len = 0;
}
- continue;
+ if (c != '\n')
+ continue;
}
if (phase != PHASE_NONE)