Patchwork [Fortran] Fix some issues found by Coverity's static-code analysis scan

login
register
mail settings
Submitter Mikael Morin
Date Sept. 16, 2012, 10:12 a.m.
Message ID <5055A5FD.5040005@sfr.fr>
Download mbox | patch
Permalink /patch/184121/
State New
Headers show

Comments

Mikael Morin - Sept. 16, 2012, 10:12 a.m.
On 15/09/2012 19:36, Tobias Burnus wrote:
> Hi Mikael,
> 
> thanks for your comments.
> 
> As a pre-script: Will you look at Paul's revised assignment patch - or
> should I do it?
I looked at it twice or so, and couldn't get the double temporary thing.
I'll get back to it.

> If you want to know the Coverity's diagnostic, you can also have access
> to GCC's Coverity scan results. Are you interested?
I have no plans to make anything out of them in the foreseeable future;
for later I don't know, why not.

> Thanks for the analysis. Will you create a patch?
> 
Attached. Tested against "*namelist*" and full regression test in
progress. OK?

Mikael
Tobias Burnus - Sept. 16, 2012, 10:43 a.m.
Mikael Morin wrote:
> On 15/09/2012 19:36, Tobias Burnus wrote:
>> As a pre-script: Will you look at Paul's revised assignment patch - or
>> should I do it?
> I looked at it twice or so, and couldn't get the double temporary thing.
> I'll get back to it.

Thanks!

>> Thanks for the analysis. Will you create a patch?
> Attached. Tested against "*namelist*" and full regression test in
> progress. OK?

OK. Thanks for the patch.

Tobias

Patch

2012-09-16  Mikael Morin  <mikael@gcc.gnu.org>

	* symbol.c (gfc_undo_symbols): Correctly undo namelists.

2012-09-16  Mikael Morin  <mikael@gcc.gnu.org>

	* gfortran.dg/namelist_75.f90: New test.

Index: symbol.c
===================================================================
--- symbol.c	(révision 191341)
+++ symbol.c	(copie de travail)
@@ -2996,7 +2996,7 @@  gfc_undo_symbols (void)
 	{
 	  if (p->namelist_tail != old->namelist_tail)
 	    {
-	      gfc_free_namelist (old->namelist_tail);
+	      gfc_free_namelist (old->namelist_tail->next);
 	      old->namelist_tail->next = NULL;
 	    }
 	}