Hi Dodji,
On 23 October 2014 at 13:11, Dodji Seketeli <[email protected]> wrote:
> /* 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. */
which is currently implemented as:
if (map != LINEMAPS_LAST_ORDINARY_MAP (set))
linemap_assert (loc + offset < MAP_START_LOCATION (&map[1]));
However, this can easily trigger in Fortran, for example, when adding
one line adds a new map, the location of the new map is 1 +
set->highest_location. If the highest_location corresponds to the
start of the previous line (because Fortran does not actually track
columns yet with line-maps) then any offset will trigger this.
One solution could be to make the new map's start location =
set->highest_location + set->max_column_hint, but I'm not sure if
there is a more conservative approach.
I'm going to propose a patch that changes the asserts to assert only
if checking otherwise return loc unchanged. That seems safer than
giving a wildly inaccurate location.
Cheers,
Manuel.