diff options
| author | mikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-06 14:47:40 +0000 |
|---|---|---|
| committer | mikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-06 14:47:40 +0000 |
| commit | 370f010cc4aeca788e048bd36b0f817d05c9558a (patch) | |
| tree | f4bcfb360a139359e574f0877bc9b5809f45c878 | |
| parent | 76c02ae83c1359dbc4cac7e16000aeef2a66d4cf (diff) | |
| download | ppe42-gcc-370f010cc4aeca788e048bd36b0f817d05c9558a.tar.gz ppe42-gcc-370f010cc4aeca788e048bd36b0f817d05c9558a.zip | |
2010-10-06 Mikael Morin <mikael@gcc.gnu.org>
* primary.c (gfc_match_structure_constructor): Invert the assert logic.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165033 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/fortran/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/fortran/primary.c | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c75bb8b7724..86175478a9c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,9 @@ 2010-10-06 Mikael Morin <mikael@gcc.gnu.org> + * primary.c (gfc_match_structure_constructor): Invert the assert logic. + +2010-10-06 Mikael Morin <mikael@gcc.gnu.org> + * primary.c (gfc_free_structure_ctor_component): Also free the component structure itself. diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 9d0deec0c8f..054c66f35dc 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -2414,8 +2414,9 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result, /* No component should be left, as this should have caused an error in the loop constructing the component-list (name that does not correspond to any component in the structure definition). */ - if (comp_head && sym->attr.extension) + if (comp_head) { + gcc_assert (sym->attr.extension); for (comp_iter = comp_head; comp_iter; comp_iter = comp_iter->next) { gfc_error ("component '%s' at %L has already been set by a " @@ -2424,8 +2425,6 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result, } goto cleanup; } - else - gcc_assert (!comp_head); e = gfc_get_structure_constructor_expr (BT_DERIVED, 0, &where); e->ts.u.derived = sym; |

