Early ping — [Patch] Fortran: Avoid double-free with parse error (PR96041, PR93423)

Tobias Burnus burnus@net-b.de
Tue Sep 15 06:11:40 GMT 2020

Early Fortran-review ping.

PR 96041 - [11 regression] ICE in gfortran.dg/pr93423.f90 after r11-1792
(opened 2020-07-03)

The other PR revealed/caused the issue:
PR 93423 - [8/9/10/11 Regression] ICE on invalid with argument list for module procedure
"Backports will have to wait until PR96041 is resolved." (Comment 5)

On 9/12/20 11:00 PM, Tobias Burnus wrote:

> The testcase for PR93423 did a double free, which caused
> an ICE. That's reported in PR96041.
> Slightly frustrated by the FAIL in the testsuite,
> I decided to debug and, hopefully, fix this.
> The problem is related to putting the symtree
> into a sub namespace of the symbol's ns. That's fixed up
> by copying things around – except in the error case where
> all those fixups are undone. Thus, when the symbol tree
> is deleted, the parent's sym->formal->sym is also deleted,
> causing an ICE in resolve_formal_arguments.
> Hopefully, I got this all right...
> I see still one memory leak for a symbol in module.c
> according to valgrind, but I don't know whether it is
> related to those symbols. (There are a lot of other leaks,
> mostly related to polymorphism (vtab etc.).)
> OK for the trunk?
> Tobias

More information about the Gcc-patches mailing list