summaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/line-map.c8
2 files changed, 11 insertions, 3 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 31d3b610284..f373dad5130 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2015-06-08 Marek Polacek <polacek@redhat.com>
+
+ PR c/66415
+ * line-map.c (linemap_position_for_loc_and_offset): Remove
+ linemap_assert_fails; reverse conditions.
+
2015-05-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
* line-map.c (LINE_MAP_MAX_COLUMN_NUMBER
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 972f66cb90b..d58cad23fdb 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -688,15 +688,17 @@ linemap_position_for_loc_and_offset (struct line_maps *set,
/* We find the real location and shift it. */
loc = linemap_resolve_location (set, loc, LRK_SPELLING_LOCATION, &map);
/* The new location (loc + offset) should be higher than the first
- location encoded by MAP. */
- if (linemap_assert_fails (MAP_START_LOCATION (map) < loc + offset))
+ location encoded by MAP.
+ FIXME: We used to linemap_assert_fails here and in the if below,
+ but that led to PR66415. So give up for now. */
+ if ((MAP_START_LOCATION (map) >= loc + offset))
return loc;
/* If MAP is not the last line map of its set, then the new location
(loc + offset) should be less than the first location encoded by
the next line map of the set. */
if (map != LINEMAPS_LAST_ORDINARY_MAP (set))
- if (linemap_assert_fails (loc + offset < MAP_START_LOCATION (&map[1])))
+ if ((loc + offset >= MAP_START_LOCATION (&map[1])))
return loc;
offset += SOURCE_COLUMN (map, loc);