This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [GOOGLE] Updates highest_location when updating next_discriminator_location


> The problem is that linemap_location_from_macro_expansion_p will
> always return true if locus has discriminator. And in linemap_lookup,
> this will lead to call linemap_macro_map_lookup, in which there is an
> assertion:
>
> linemap_assert (line >= LINEMAPS_MACRO_LOWEST_LOCATION (set));
>
> However, line is actually not a macro location.

That sounds like we're leaking a discriminator location into the
linemap code. Before you can call
linemap_location_from_macro_expansion_p, you need to do this (as in
expand_location_1):

  /* If LOC describes a location with a discriminator, extract the
     discriminator and map it to the real location.  */
  if (min_discriminator_location != UNKNOWN_LOCATION
      && loc >= min_discriminator_location
      && loc < next_discriminator_location)
    loc = map_discriminator_location (loc);

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]