aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog7
-rw-r--r--libcpp/line-map.c4
2 files changed, 11 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index ae05d6b..8af9846 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,10 @@
+2019-02-11 Martin Liska <mliska@suse.cz>
+
+ PR lto/88147
+ * line-map.c (linemap_line_start): Don't reuse the existing line
+ map if the line offset is sufficiently large to cause overflow
+ when computing location_t values.
+
2019-01-26 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/88974
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index ff679ed..0e30b4b 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -742,6 +742,10 @@ linemap_line_start (struct line_maps *set, linenum_type to_line,
if (line_delta < 0
|| last_line != ORDINARY_MAP_STARTING_LINE_NUMBER (map)
|| SOURCE_COLUMN (map, highest) >= (1U << (column_bits - range_bits))
+ || ( /* We can't reuse the map if the line offset is sufficiently
+ large to cause overflow when computing location_t values. */
+ (to_line - ORDINARY_MAP_STARTING_LINE_NUMBER (map))
+ >= (1U << (CHAR_BIT * sizeof (linenum_type) - column_bits)))
|| range_bits < map->m_range_bits)
map = linemap_check_ordinary
(const_cast <line_map *>