+2010-10-06 Mikael Morin <mikael@gcc.gnu.org>
+
+ * resolve.c (check_typebound_baseobject): Free local expr before
+ returning.
+
2010-10-06 Mikael Morin <mikael@gcc.gnu.org>
* primary.c (gfc_match_structure_constructor): Invert the assert logic.
check_typebound_baseobject (gfc_expr* e)
{
gfc_expr* base;
+ gfc_try return_value = FAILURE;
base = extract_compcall_passed_object (e);
if (!base)
{
gfc_error ("Base object for type-bound procedure call at %L is of"
" ABSTRACT type '%s'", &e->where, base->ts.u.derived->name);
- return FAILURE;
+ goto cleanup;
}
/* If the procedure called is NOPASS, the base object must be scalar. */
{
gfc_error ("Base object for NOPASS type-bound procedure call at %L must"
" be scalar", &e->where);
- return FAILURE;
+ goto cleanup;
}
/* FIXME: Remove once PR 41177 (this problem) is fixed completely. */
{
gfc_error ("Non-scalar base object at %L currently not implemented",
&e->where);
- return FAILURE;
+ goto cleanup;
}
- return SUCCESS;
+ return_value = SUCCESS;
+
+cleanup:
+ gfc_free_expr (base);
+ return return_value;
}