X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=libcpp%2Fline-map.c;h=a82c4286f07ba2d48bde4b2d5a9e7c4008651a24;hp=cce699f3cfea17fee86c2394026537256cdb5113;hb=33fa939f74daa3460d1560d23e26caeaf84828a1;hpb=6bc9506f51c864af73250f5e6c99da261bd98b11 diff --git a/libcpp/line-map.c b/libcpp/line-map.c index cce699f3cfe..a82c4286f07 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -38,8 +38,8 @@ linemap_init (struct line_maps *set) set->trace_includes = false; set->depth = 0; set->cache = 0; - set->highest_location = 0; - set->highest_line = 0; + set->highest_location = RESERVED_LOCATION_COUNT - 1; + set->highest_line = RESERVED_LOCATION_COUNT - 1; set->max_column_hint = 0; set->reallocator = 0; } @@ -109,9 +109,12 @@ linemap_add (struct line_maps *set, enum lc_reason reason, map = &set->maps[set->used]; - if (to_file && *to_file == '\0') + if (to_file && *to_file == '\0' && reason != LC_RENAME_VERBATIM) to_file = ""; + if (reason == LC_RENAME_VERBATIM) + reason = LC_RENAME; + /* If we don't keep our line maps consistent, we can easily segfault. Don't rely on the client to do it for us. */ if (set->depth == 0)