2011-09-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/50401
* resolve.c (resolve_transfer): Check if component 'ref' is defined.
PR fortran/50403
* symbol.c (gfc_use_derived): Check if argument 'sym' is defined.
2011-09-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/50401
PR fortran/50403
* gfortran.dg/function_types_3.f90: New.
From-SVN: r178889
+2011-09-15 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50401
+ * resolve.c (resolve_transfer): Check if component 'ref' is defined.
+
+ PR fortran/50403
+ * symbol.c (gfc_use_derived): Check if argument 'sym' is defined.
+
2011-09-14 Tobias Burnus <burnus@net-b.de>
PR fortran/34547
}
}
- if (sym->as != NULL && sym->as->type == AS_ASSUMED_SIZE
+ if (sym->as != NULL && sym->as->type == AS_ASSUMED_SIZE && exp->ref
&& exp->ref->type == REF_ARRAY && exp->ref->u.ar.type == AR_FULL)
{
gfc_error ("Data transfer element at %L cannot be a full reference to "
gfc_symtree *st;
int i;
+ if (!sym) return NULL;
+
if (sym->components != NULL || sym->attr.zero_comp)
return sym; /* Already defined. */
+2011-09-15 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50401
+ PR fortran/50403
+ * gfortran.dg/function_types_3.f90: New.
+
2011-09-15 Jason Merrill <jason@redhat.com>
PR c++/50365
--- /dev/null
+! { dg-do compile }
+!
+! Contributed by Vittorio Zecca <zeccav@gmail.com>
+!
+! PR 50401: SIGSEGV in resolve_transfer
+
+ interface
+ function f() ! { dg-error "must be a dummy argument" }
+ dimension f(*)
+ end function
+ end interface
+ print *,f()
+end
+
+! PR 50403: SIGSEGV in gfc_use_derived
+
+type(f) function f() ! { dg-error "conflicts with DERIVED attribute|is not accessible" }
+ f=110 ! { dg-error "Unclassifiable statement" }
+end