diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-02-11 19:31:35 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-02-11 19:31:35 +0000 |
commit | a8beb4f853905ef08a66efdc2d151c7df845dabb (patch) | |
tree | 75003c5106d9b285a646fbd1ec12c8c698d754a2 /gcc/fortran/decl.c | |
parent | f91cd24703d5f8130f03ab9f317791af78397528 (diff) | |
download | gcc-a8beb4f853905ef08a66efdc2d151c7df845dabb.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156709 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 82c67ae0045..0f3898f7844 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; |