[Patch, Fortran] PR 41755 - Fix segfault for invalid EQUIVALENCE

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Oct 19 16:52:00 GMT 2009


On Mon, Oct 19, 2009 at 06:37:59PM +0200, Tobias Burnus wrote:
> I think the patch is obvious. As it works with 4.2, it is a regression.
> 
> The FIXME change is unrelated and small - and obviously only for the trunk.
> 
> Build and regtested on x86-64-linux.
> OK for the trunk and 4.4? - I can also commit it for 4.3, if deemed useful.
> 

I have a slightly different patch, which should probably
be combined with your patch.

Index: match.c
===================================================================
--- match.c	(revision 152863)
+++ match.c	(working copy)
@@ -3750,7 +3750,10 @@ gfc_match_equivalence (void)
       if (gfc_match_eos () == MATCH_YES)
 	break;
       if (gfc_match_char (',') != MATCH_YES)
-	goto syntax;
+	{
+	  gfc_error ("Expecting a comma in EQUIVALENCE at %C");
+	  goto cleanup;
+	}
     }
 
   return MATCH_YES;

BTW, it looks like your patch contains some unrelated changes.

-- 
Steve



More information about the Fortran mailing list