re PR fortran/41755 (Segfault on invalid code)

2009-10-19  Tobias Burnus  <burnus@net-b.de>
            Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/41755
        * symbol.c (gfc_undo_symbols): Add NULL check.
        * match.c (gfc_match_equivalence): Add check for
        missing comma.

2009-10-19  Tobias Burnus  <burnus@net-b.de>

        PR fortran/41755
        * gfortran.dg/equiv_8.f90: New test.


Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>

From-SVN: r152987
This commit is contained in:
Tobias Burnus 2009-10-19 21:18:12 +02:00 committed by Tobias Burnus
parent 16fd3ccfbd
commit 69bed0e60b
5 changed files with 25 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2009-10-19 Tobias Burnus <burnus@net-b.de>
PR fortran/41755
* gfortran.dg/equiv_8.f90: New test.
2009-10-15 Release Manager
* GCC 4.4.2 released.

View File

@ -3269,7 +3269,10 @@ gfc_match_equivalence (void)
if (gfc_match_eos () == MATCH_YES)
break;
if (gfc_match_char (',') != MATCH_YES)
goto syntax;
{
gfc_error ("Expecting a comma in EQUIVALENCE at %C");
goto cleanup;
}
}
return MATCH_YES;

View File

@ -2693,7 +2693,7 @@ gfc_undo_symbols (void)
if (p->gfc_new)
{
/* Symbol was new. */
if (p->attr.in_common && p->common_block->head)
if (p->attr.in_common && p->common_block && p->common_block->head)
{
/* If the symbol was added to any common block, it
needs to be removed to stop the resolver looking

View File

@ -1,3 +1,11 @@
2009-10-19 Tobias Burnus <burnus@net-b.de>
Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/41755
* symbol.c (gfc_undo_symbols): Add NULL check.
* match.c (gfc_match_equivalence): Add check for
missing comma.
2009-10-15 Jason Merrill <jason@redhat.com>
PR c++/38798

View File

@ -0,0 +1,7 @@
! { dg-do compile }
!
! PR fortran/41755
!
common /uno/ aa
equivalence (aa,aaaaa) (bb,cc) ! { dg-error "Expecting a comma in EQUIVALENCE" }
end