summaryrefslogtreecommitdiff
path: root/gcc/fortran/data.c
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-03 22:14:55 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-03 22:14:55 +0000
commit2f427a5c5bf7828bdc4f42fa318ff6967d476358 (patch)
tree4352b8947dcf2586ceea4b93620531d88a0240f0 /gcc/fortran/data.c
parent990be1d528036444e6dae4a5ac44df5d3dbb5f85 (diff)
downloadgcc-2f427a5c5bf7828bdc4f42fa318ff6967d476358.tar.gz
2007-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/32432 * gfortran.h: Change type of gfc_assign_data_value from void to try. * data.c (gfc_assign_data_value): Return FAILURE if error found. * resolve.c (check_data_variable): If gfc_assign_data_value returns failure, break out of loop and return failure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126282 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/data.c')
-rw-r--r--gcc/fortran/data.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/fortran/data.c b/gcc/fortran/data.c
index 35213a8fdb3..3c86bc860d4 100644
--- a/gcc/fortran/data.c
+++ b/gcc/fortran/data.c
@@ -245,7 +245,7 @@ create_character_intializer (gfc_expr *init, gfc_typespec *ts,
LVALUE already has an initialization, we extend this, otherwise we
create a new one. */
-void
+try
gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index)
{
gfc_ref *ref;
@@ -293,8 +293,7 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index)
gfc_error ("'%s' at %L already is initialized at %L",
lvalue->symtree->n.sym->name, &lvalue->where,
&init->where);
- gfc_free_expr (init);
- init = NULL;
+ return FAILURE;
}
if (init == NULL)
@@ -423,6 +422,8 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index)
symbol->value = expr;
else
last_con->expr = expr;
+
+ return SUCCESS;
}