[PATCH] ipa-param-manip: Be careful about a reallocating hash_map (PR 103449)

Jan Hubicka hubicka@kam.mff.cuni.cz
Mon Nov 29 18:19:13 GMT 2021


> Hi,
> 
> PR 103449 revealed that when I was storing result of one hash_map
> lookup into another entry in the hash_map, I was still accessing the
> entry in the table, which meanwhile could get reallocated, making the
> accesses invalid-after-free.
> 
> Fixed with the following, which also simplifies the return statement
> which must have been true even now.
> 
> Bootstrapped and tested on x86_64-linux.  OK for master?
> 
> Thanks,
> 
> Martin
> 
> 
> gcc/ChangeLog:
> 
> 2021-11-29  Martin Liska  <mliska@suse.cz>
> 	    Martin Jambor  <mjambor@suse.cz>
> 
> 	PR ipa/103449
> 	* ipa-param-manipulation.c
> 	(ipa_param_body_adjustments::prepare_debug_expressions): Be
> 	careful about hash_map reallocating itself.  Simpify a return
> 	which always returns true.
OK, thanks!
Honza


More information about the Gcc-patches mailing list