From dca77993f1a0a3cfc135f33b5d125f0bb64fa481 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 20 Oct 2015 21:04:14 -0400 Subject: [PATCH 23/26] FIXME: cope with ad-hoc locs in linemap_macro_loc_to_spelling_point --- libcpp/line-map.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libcpp/line-map.c b/libcpp/line-map.c index 676beb8..dc393af 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -1101,6 +1101,7 @@ linemap_macro_map_loc_unwind_toward_spelling (const line_map_macro* map, linemap_assert (linemap_macro_expansion_map_p (map) && location >= MAP_START_LOCATION (map)); linemap_assert (location >= RESERVED_LOCATION_COUNT); + linemap_assert (!IS_ADHOC_LOC (location)); token_no = location - MAP_START_LOCATION (map); linemap_assert (token_no < MACRO_MAP_NUM_MACRO_TOKENS (map)); @@ -1385,6 +1386,9 @@ linemap_macro_loc_to_spelling_point (struct line_maps *set, struct line_map *map; linemap_assert (set && location >= RESERVED_LOCATION_COUNT); + if (IS_ADHOC_LOC (location)) + location = get_location_from_adhoc_loc (set, location); + while (true) { map = const_cast (linemap_lookup (set, location)); -- 1.8.5.3