From: Jakub Jelinek Date: Thu, 11 Feb 2010 19:31:35 +0000 (+0100) Subject: re PR fortran/43029 (enum_5.f90 ICE under valgrind) X-Git-Tag: releases/gcc-4.5.0~810 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01e64c3dc777ec3515ca89cb279410edab2fc5c2;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5efa90cdcfa3..956d73ca9875 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2010-02-11 Jakub Jelinek + + 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. + 2010-02-10 Joost VandeVondele Tobias Burnus diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 82c67ae00459..0f3898f7844c 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;