aboutsummaryrefslogtreecommitdiff
path: root/libcpp/line-map.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-02-18 10:46:19 +0100
committerMartin Liska <marxin@gcc.gnu.org>2019-02-18 09:46:19 +0000
commita5f87af7edff53d77f51ba253da42dbfc74ada58 (patch)
treef51cf0bf3c676fa8957800bbdfdc02e623a870d1 /libcpp/line-map.c
parent469b4adb4fec2b61caee16ed982f5fab333e784b (diff)
downloadgcc-a5f87af7edff53d77f51ba253da42dbfc74ada58.zip
gcc-a5f87af7edff53d77f51ba253da42dbfc74ada58.tar.gz
gcc-a5f87af7edff53d77f51ba253da42dbfc74ada58.tar.bz2
Use 1UL constant in order to not overflow (PR c++/89383).
2019-02-18 Martin Liska <mliska@suse.cz> PR c++/89383 * line-map.c (linemap_line_start): Use 1UL in order to not overflow. From-SVN: r268981
Diffstat (limited to 'libcpp/line-map.c')
-rw-r--r--libcpp/line-map.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 0e30b4b..b73f506 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -745,7 +745,8 @@ linemap_line_start (struct line_maps *set, linenum_type to_line,
|| ( /* 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)))
+ >= (((uint64_t) 1)
+ << (CHAR_BIT * sizeof (linenum_type) - column_bits)))
|| range_bits < map->m_range_bits)
map = linemap_check_ordinary
(const_cast <line_map *>