re PR preprocessor/60436 (C preprocessor segfaults on assembly file)
authorJakub Jelinek <jakub@redhat.com>
Tue, 25 Nov 2014 11:16:27 +0000 (12:16 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 25 Nov 2014 11:16:27 +0000 (12:16 +0100)
PR preprocessor/60436
* line-map.c (linemap_line_start): If highest is above 0x60000000
and we are still tracking columns or highest is above 0x70000000,
force add_map.

From-SVN: r218042

libcpp/ChangeLog
libcpp/line-map.c

index 49f374de317aac37d175b7c9800a6df78c7b3025..e04130a8df738bba3809a52e03ef99c1e3e68653 100644 (file)
@@ -1,3 +1,10 @@
+2014-11-25  Jakub Jelinek  <jakub@redhat.com>
+
+       PR preprocessor/60436
+       * line-map.c (linemap_line_start): If highest is above 0x60000000
+       and we are still tracking columns or highest is above 0x70000000,
+       force add_map.
+
 2014-11-20  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/63966
index aff0294936c3e2526bdfd01440ac192f811a54b2..39c057f74982cde133a58c151f63d983b25de942 100644 (file)
@@ -529,10 +529,10 @@ linemap_line_start (struct line_maps *set, linenum_type to_line,
          && line_delta * ORDINARY_MAP_NUMBER_OF_COLUMN_BITS (map) > 1000)
       || (max_column_hint >= (1U << ORDINARY_MAP_NUMBER_OF_COLUMN_BITS (map)))
       || (max_column_hint <= 80
-         && ORDINARY_MAP_NUMBER_OF_COLUMN_BITS (map) >= 10))
-    {
-      add_map = true;
-    }
+         && ORDINARY_MAP_NUMBER_OF_COLUMN_BITS (map) >= 10)
+      || (highest > 0x60000000
+         && (set->max_column_hint || highest > 0x70000000)))
+    add_map = true;
   else
     max_column_hint = set->max_column_hint;
   if (add_map)
@@ -543,7 +543,7 @@ linemap_line_start (struct line_maps *set, linenum_type to_line,
          /* If the column number is ridiculous or we've allocated a huge
             number of source_locations, give up on column numbers. */
          max_column_hint = 0;
-         if (highest >0x70000000)
+         if (highest > 0x70000000)
            return 0;
          column_bits = 0;
        }