diff mbox

[fortran] PR44662 - unitialized memory with typebound procedures

Message ID 4C2E1EA8.802@sfr.fr
State New
Headers show

Commit Message

Mikael Morin July 2, 2010, 5:15 p.m. UTC
Hello,

this could probably go in as obvious, but as I haven't committed 
anything since ... well, last time, I would like a "OK to mess around 
again".

Currently regression testing. OK for trunk if it passes ?

Mikael
2010-07-02  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/44662
	* decl.c (match_procedure_in_type): Clear structure before using.
	(gfc_match_generic): Ditto.

Comments

Steve Kargl July 2, 2010, 6:12 p.m. UTC | #1
On Fri, Jul 02, 2010 at 07:15:20PM +0200, Mikael Morin wrote:
> Hello,
> 
> this could probably go in as obvious, but as I haven't committed 
> anything since ... well, last time, I would like a "OK to mess around 
> again".
> 
> Currently regression testing. OK for trunk if it passes ?
> 

It does appear to be obvious.

OK.
diff mbox

Patch

diff --git a/decl.c b/decl.c
index 07c3acb..e5ef139 100644
--- a/decl.c
+++ b/decl.c
@@ -7697,8 +7697,8 @@  match_procedure_in_type (void)
     }
 
   /* Construct the data structure.  */
+  memset (&tb, 0, sizeof (tb));
   tb.where = gfc_current_locus;
-  tb.is_generic = 0;
 
   /* Match binding attributes.  */
   m = match_binding_attributes (&tb, false, false);
@@ -7856,6 +7856,9 @@  gfc_match_generic (void)
   ns = block->f2k_derived;
   gcc_assert (block && ns);
 
+  memset (&tbattr, 0, sizeof (tbattr));
+  tbattr.where = gfc_current_locus;
+
   /* See if we get an access-specifier.  */
   m = match_binding_attributes (&tbattr, true, false);
   if (m == MATCH_ERROR)