aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-12-19 06:03:51 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-12-19 06:03:51 +0000
commitd5338d09e5352b939227c27997a0120b50d649be (patch)
treeb65a6e0da38ccfd243a0ba0325bae4961c4a4f5b /libcpp
parent51426017f8fe0f18295ca467feba3fbb5aad3fa8 (diff)
parent951e27f58ca5c7f33124407079c383706e99c68d (diff)
downloadgcc-d5338d09e5352b939227c27997a0120b50d649be.zip
gcc-d5338d09e5352b939227c27997a0120b50d649be.tar.gz
gcc-d5338d09e5352b939227c27997a0120b50d649be.tar.bz2
Merge from trunk revision 279561.
From-SVN: r279562
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog15
-rw-r--r--libcpp/charset.c12
-rw-r--r--libcpp/include/cpplib.h1
3 files changed, 26 insertions, 2 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 2090bd7..a11da28 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,18 @@
+2019-12-18 David Malcolm <dmalcolm@redhat.com>
+
+ PR preprocessor/92982
+ * charset.c
+ (cpp_string_location_reader::cpp_string_location_reader): Delete
+ initialization of m_line_table.
+ * include/cpplib.h (cpp_string_location_reader::m_line_table):
+ Delete unused member.
+
+2019-12-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/92919
+ * charset.c (wide_str_to_charconst): If str contains just the
+ NUL terminator, punt quietly.
+
2019-12-09 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (label_text::label_text): Make private.
diff --git a/libcpp/charset.c b/libcpp/charset.c
index 956d2da..5da39a6 100644
--- a/libcpp/charset.c
+++ b/libcpp/charset.c
@@ -1970,6 +1970,17 @@ wide_str_to_charconst (cpp_reader *pfile, cpp_string str,
size_t off, i;
cppchar_t result = 0, c;
+ if (str.len <= nbwc)
+ {
+ /* Error recovery, if no errors have been diagnosed previously,
+ there should be at least two wide characters. Empty literals
+ are diagnosed earlier and we can get just the zero terminator
+ only if there were errors diagnosed during conversion. */
+ *pchars_seen = 0;
+ *unsignedp = 0;
+ return 0;
+ }
+
/* This is finicky because the string is in the target's byte order,
which may not be our byte order. Only the last character, ignoring
the NUL terminator, is relevant. */
@@ -2237,7 +2248,6 @@ _cpp_default_encoding (void)
cpp_string_location_reader::
cpp_string_location_reader (location_t src_loc,
line_maps *line_table)
-: m_line_table (line_table)
{
src_loc = get_range_from_loc (line_table, src_loc).m_start;
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index e199aec..1349871 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -912,7 +912,6 @@ class cpp_string_location_reader {
private:
location_t m_loc;
int m_offset_per_column;
- line_maps *m_line_table;
};
/* A class for storing the source ranges of all of the characters within