This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[fortran, patch] PR17741 ICE in gfc_free_namespace, at fortran/symbol.c:2208


The attached patch is trivial. The refs count in current_ns was not being bumped up for initial function declarations. So when an error occurs and we bail out early, we were getting an assert in gfc_free_namespace when the statement is rejected.

Putting the added line in gfc_match_function_decl () instead also solves the problem.

Regression tested on i686-linux.

OK for 4.3?

Regards,

Jerry

2006-10-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>

	PR fortran/17741
	* decl.c (get_proc_name): Bump current namespace refs count.



Index: decl.c
===================================================================
*** decl.c	(revision 118121)
--- decl.c	(working copy)
*************** get_proc_name (const char *name, gfc_sym
*** 642,647 ****
--- 642,648 ----
      rc = gfc_get_symbol (name, gfc_current_ns->parent, result);
  
    sym = *result;
+   gfc_current_ns->refs++;
  
    if (sym && !sym->new && gfc_current_state () != COMP_INTERFACE)
      {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]