This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/66415] [6 Regression] ice in location_column_from_byte_offset
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 04 Jun 2015 08:50:16 +0000
- Subject: [Bug c/66415] [6 Regression] ice in location_column_from_byte_offset
- Auto-submitted: auto-generated
- References: <bug-66415-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66415
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Thus:
--- a/gcc/c-family/c-format.c
+++ b/gcc/c-family/c-format.c
@@ -142,9 +142,11 @@ location_from_offset (location_t loc, int offset)
expanded_location s = expand_location_to_spelling_point (loc);
int line_width;
const char *line = location_get_source_line (s, &line_width);
+ if (line == NULL)
+ return loc;
line += s.column - 1 ;
line_width -= s.column - 1;
- unsigned int column =
+ unsigned int column =
location_column_from_byte_offset (line, line_width, (unsigned) offset);
return linemap_position_for_loc_and_offset (line_table, loc, column);
Manuel, does that look fine to you?
Most likely started with r223470. Trying to reduce ...