mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-24 07:09:12 +08:00
symbol.c (gfc_undo_symbols): Correctly undo namelists.
fortran/ * symbol.c (gfc_undo_symbols): Correctly undo namelists. testsuite/ * gfortran.dg/namelist_75.f90: New test. From-SVN: r191357
This commit is contained in:
parent
ca4a1c8cb9
commit
15319c3ed9
@ -1,3 +1,7 @@
|
||||
2012-09-16 Mikael Morin <mikael@gcc.gnu.org>
|
||||
|
||||
* symbol.c (gfc_undo_symbols): Correctly undo namelists.
|
||||
|
||||
2012-09-15 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
* trans-io.c (gfc_trans_transfer): Add an assert.
|
||||
|
@ -2996,7 +2996,7 @@ gfc_undo_symbols (void)
|
||||
{
|
||||
if (p->namelist_tail != old->namelist_tail)
|
||||
{
|
||||
gfc_free_namelist (old->namelist_tail);
|
||||
gfc_free_namelist (old->namelist_tail->next);
|
||||
old->namelist_tail->next = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,7 @@
|
||||
2012-09-16 Mikael Morin <mikael@gcc.gnu.org>
|
||||
|
||||
* gfortran.dg/namelist_75.f90: New test.
|
||||
|
||||
2012-09-15 Tom de Vries <tom@codesourcery.com>
|
||||
|
||||
* gcc.dg/tree-ssa/vrp82.c: New test.
|
||||
|
10
gcc/testsuite/gfortran.dg/namelist_75.f90
Normal file
10
gcc/testsuite/gfortran.dg/namelist_75.f90
Normal file
@ -0,0 +1,10 @@
|
||||
! { dg-do compile }
|
||||
!
|
||||
! Tests a write-after-free memory error fix in gfc_undo_symbols
|
||||
|
||||
program test_nml
|
||||
|
||||
namelist /foo/ bar, baz
|
||||
namelist /foo/ wrong, , ! { dg-error "Syntax error in NAMELIST" }
|
||||
|
||||
end program test_nml
|
Loading…
Reference in New Issue
Block a user