aboutsummaryrefslogtreecommitdiff
path: root/libcpp/line-map.c
diff options
context:
space:
mode:
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 6a695ab..6675634 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -678,7 +678,8 @@ linemap_position_for_loc_and_offset (struct line_maps *set,
linemap_position_for_line_and_column (map,
SOURCE_LINE (map, loc),
offset);
- if (linemap_assert_fails (map == linemap_lookup (set, r)))
+ if (linemap_assert_fails (r <= set->highest_location)
+ || linemap_assert_fails (map == linemap_lookup (set, r)))
return loc;
return r;