]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport r268981
authorMartin Liska <mliska@suse.cz>
Mon, 11 Mar 2019 11:18:22 +0000 (12:18 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Mon, 11 Mar 2019 11:18:22 +0000 (11:18 +0000)
2019-03-11  Martin Liska  <mliska@suse.cz>

Backport from mainline
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: r269577

libcpp/ChangeLog
libcpp/line-map.c

index df7072e6fa194191d45c9f6fa0e554c43f811097..ee3cdb2cfd6e711975ae5e456c6fbcfaedfe299a 100644 (file)
@@ -1,3 +1,12 @@
+2019-03-11  Martin Liska  <mliska@suse.cz>
+
+       Backport from mainline
+       2019-02-18  Martin Liska  <mliska@suse.cz>
+
+       PR c++/89383
+       * line-map.c (linemap_line_start): Use 1UL in order
+       to not overflow.
+
 2019-03-11  Martin Liska  <mliska@suse.cz>
 
        Backport from mainline
index 5827f303b6df97581be6fe9ea2ef70fb387fff6e..ddcb0111f4b3987ef69ff7a63bb781ad86e17a62 100644 (file)
@@ -756,7 +756,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 *>