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: [patch] Enable the use of a resolution file


On Tue, Nov 10, 2009 at 12:39, Rafael Espindola <espindola@google.com> wrote:

> lto/
> 2009-11-10 ÂRafael Avila de Espindola Â<espindola@google.com>
>
> Â Â Â Â* lang.opt (fresolution): Renamed from resolution.
> Â Â Â Â* lto-lang.c (lto_handle_option): Handle new option name.
> Â Â Â Â* lto.c (lto_resolution_read): Add more checks. Discard rest of line.

OK with one nit:

> @@ -303,9 +306,8 @@ lto_resolution_read (FILE *resolution, const char *file_name)
>  	      break;
>  	    }
>  	}
> -      if (j >= lto_resolution_str_len)
> -	internal_error ("tried to read past the end of the linker resolution "
> -			"file");
> +      if (j == lto_resolution_str_len)
> +	internal_error ("Invalid resolution in the resolution file.");

Seems safer to keep the original '>=' test instead of '=='.  The
loop now guarantees that '==' is sufficient, so this mostly
protects it from future code rearrangements.


Diego.


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