[Bug fortran/40246] ICE on invalid SOURCE= using NULLIFY
burnus at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue May 26 14:45:00 GMT 2009
------- Comment #3 from burnus at gcc dot gnu dot org 2009-05-26 14:45 -------
> > The following patch to gfc_match_nullify fixes it; however, I think one
> > should additionally add
> > gfc_free_expr (new_st.expr1);
> > gfc_free_expr (new_st.expr2);
> > to prevent a memory leak.
>
> AFAICT, there is no leak.
>
> gfc_free_statement (gfc_code *p)
Well, I only see a call to "gfc_free_statement (new_st.next)". Thus only
"new_st->next" and not "new_st" is touched. However, we added two expressions
to new_st, viz expr1 and expr2, which I believe need to be freed.
(Seemingly, we cannot free new_st itself, which would be simpler.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40246
More information about the Gcc-bugs
mailing list