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] Fix ipa-prop for vector reallocation (PR other/37419)


> Hi!
> 
> When a call appends to a vector and might actually need to reallocate it,
> passing the vector around as VEC (cgraph_edge_p, heap) *new_edges is fatal,
> as the caller after reallocation will work with freed memory.  We need
> to pass the VEC * by reference.  Also, the ipa_check_create_edge_args ()
> call in update_call_notes_after_inlining might reallocate the vector
> for IPA_EDGE_REF, which means top would be in freed memory.  Fixed by
> rereading it after the ipa_check_create_edge_args call.
> Without this valgrind, glibc malloc and ElectricFence complain loudly.
Nasty...
> 
> Ok for trunk?
OK,
thanks!

Honza


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