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: avoid null ptr deref in cselib_record_sets


On Wed, Dec 05, 2018 at 04:50:19AM -0200, Alexandre Oliva wrote:
> Jeff tested this with a cross compiler to h8300-elf, and several other
> native and cross toolchains IIUC.  I'm regstrapping it myself on i686-
> and x86_64-linux-gnu.  Ok to install?
> 
> 
> for  gcc/ChangeLog
> 
> 	* cselib.c (cselib_record_sets): Skip strict low part sets
> 	with NULL src_elt.

Ok, thanks.

> --- a/gcc/cselib.c
> +++ b/gcc/cselib.c
> @@ -2616,6 +2616,7 @@ cselib_record_sets (rtx_insn *insn)
>  	 preserves the upper bits that di:SI=zero_extend(flags:CCNO<=0).  */
>        scalar_int_mode mode;
>        if (dest != orig
> +	  && sets[i].src_elt
>  	  && cselib_record_sets_hook
>  	  && REG_P (dest)
>  	  && HARD_REGISTER_P (dest)

	Jakub


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