aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2010-10-06 14:52:02 +0000
committerMikael Morin <mikael@gcc.gnu.org>2010-10-06 14:52:02 +0000
commit99b41d521c30ba7e44683fa6adcd657122a92c34 (patch)
tree5c8f6fffc802b0807ba3dde4f32122027c01cad1 /gcc/fortran/resolve.c
parent3bf9ef1bc4eb7b28998569beecc1c1c750cf5b7a (diff)
downloadgcc-99b41d521c30ba7e44683fa6adcd657122a92c34.zip
gcc-99b41d521c30ba7e44683fa6adcd657122a92c34.tar.gz
gcc-99b41d521c30ba7e44683fa6adcd657122a92c34.tar.bz2
resolve.c (check_typebound_baseobject): Free local expr before returning.
2010-10-06 Mikael Morin <mikael@gcc.gnu.org> * resolve.c (check_typebound_baseobject): Free local expr before returning. From-SVN: r165034
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 5cac71e..203f294 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -5404,6 +5404,7 @@ static gfc_try
check_typebound_baseobject (gfc_expr* e)
{
gfc_expr* base;
+ gfc_try return_value = FAILURE;
base = extract_compcall_passed_object (e);
if (!base)
@@ -5415,7 +5416,7 @@ check_typebound_baseobject (gfc_expr* e)
{
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. */
@@ -5423,7 +5424,7 @@ check_typebound_baseobject (gfc_expr* e)
{
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. */
@@ -5431,10 +5432,14 @@ check_typebound_baseobject (gfc_expr* e)
{
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;
}