aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-02-11 20:31:35 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2010-02-11 20:31:35 +0100
commit01e64c3dc777ec3515ca89cb279410edab2fc5c2 (patch)
tree75003c5106d9b285a646fbd1ec12c8c698d754a2 /gcc/fortran/decl.c
parent4094aee8bf71ddd667f7f2c96534ac9af2ab0679 (diff)
downloadgcc-01e64c3dc777ec3515ca89cb279410edab2fc5c2.zip
gcc-01e64c3dc777ec3515ca89cb279410edab2fc5c2.tar.gz
gcc-01e64c3dc777ec3515ca89cb279410edab2fc5c2.tar.bz2
re PR fortran/43029 (enum_5.f90 ICE under valgrind)
PR fortran/43029 * decl.c (enumerator_decl): Don't call gfc_free_enum_history here. (gfc_match_enumerator_def): But here whenever enumerator_decl returns MATCH_ERROR. From-SVN: r156709
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 82c67ae..0f3898f 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -7124,10 +7124,9 @@ enumerator_decl (void)
if (initializer == NULL || initializer->ts.type != BT_INTEGER)
{
- gfc_error("ENUMERATOR %L not initialized with integer expression",
- &var_locus);
+ gfc_error ("ENUMERATOR %L not initialized with integer expression",
+ &var_locus);
m = MATCH_ERROR;
- gfc_free_enum_history ();
goto cleanup;
}
@@ -7193,7 +7192,10 @@ gfc_match_enumerator_def (void)
{
m = enumerator_decl ();
if (m == MATCH_ERROR)
- goto cleanup;
+ {
+ gfc_free_enum_history ();
+ goto cleanup;
+ }
if (m == MATCH_NO)
break;