From b93c07227e9ce2ee03d1cdc5ae2250fef3b0c130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez?= Date: Thu, 4 Dec 2014 23:35:29 +0000 Subject: line-map.c (linemap_position_for_loc_and_offset): Add new linemap_assert_fails. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libcpp/ChangeLog: 2014-12-05 Manuel López-Ibáñez * line-map.c (linemap_position_for_loc_and_offset): Add new linemap_assert_fails. gcc/fortran/ChangeLog: 2014-12-05 Manuel López-Ibáñez * scanner.c (gfc_next_char_literal): Use gfc_warning_now. (load_file): Use the line length as the column hint for linemap_line_start. Reserve a location for the highest column of the line. From-SVN: r218407 --- libcpp/ChangeLog | 5 +++++ libcpp/line-map.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'libcpp') diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index afb0f79..e26c8c9 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,8 @@ +2014-12-05 Manuel López-Ibáñez + + * line-map.c (linemap_position_for_loc_and_offset): Add new + linemap_assert_fails. + 2014-12-02 Manuel López-Ibáñez * include/line-map.h (linemap_assert_fails): Declare. 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; -- cgit v1.1