diff options
author | Tobias Burnus <burnus@net-b.de> | 2013-10-21 21:39:19 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2013-10-21 21:39:19 +0200 |
commit | 2be03814e43ebe51168d3f333f1887e210175fe5 (patch) | |
tree | d903ec07483c44f0019ac602b7825fcb4bbae746 | |
parent | 4d64880731674947fa017c3acb42c20cb8942be1 (diff) | |
download | gcc-2be03814e43ebe51168d3f333f1887e210175fe5.zip gcc-2be03814e43ebe51168d3f333f1887e210175fe5.tar.gz gcc-2be03814e43ebe51168d3f333f1887e210175fe5.tar.bz2 |
re PR fortran/58803 (Proc-pointer component: free_components deallocates twice pointer p->tb at symbol.c:2068)
2013-10-21 Tobias Burnus <burnus@net-b.de>
PR fortran/58803
* decl.c (match_ppc_decl): Prevent later
double free.
2013-10-21 Tobias Burnus <burnus@net-b.de>
PR fortran/58803
* gfortran.dg/proc_ptr_comp_38.f90: New.
From-SVN: r203909
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/proc_ptr_comp_38.f90 | 12 |
4 files changed, 31 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 067d1fd..5e51f2b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2013-10-21 Tobias Burnus <burnus@net-b.de> + + PR fortran/58803 + * decl.c (match_ppc_decl): Prevent later + double free. + 2013-10-17 Andrew MacLeod <amacleod@redhat.com> * trans-openmp.c: Include omp-low.h. diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 3a8175f..9c9fd4f 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -5055,7 +5055,14 @@ match_ppc_decl (void) if (!gfc_add_proc (&c->attr, name, NULL)) return MATCH_ERROR; - c->tb = tb; + if (num == 1) + c->tb = tb; + else + { + c->tb = XCNEW (gfc_typebound_proc); + c->tb->where = gfc_current_locus; + *c->tb = *tb; + } /* Set interface. */ if (proc_if != NULL) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c919285..4f277ac 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-10-21 Tobias Burnus <burnus@net-b.de> + + PR fortran/58803 + * gfortran.dg/proc_ptr_comp_38.f90: New. + 2013-10-21 Marek Polacek <polacek@redhat.com> PR middle-end/58809 diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_38.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_38.f90 new file mode 100644 index 0000000..2a71ca0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_38.f90 @@ -0,0 +1,12 @@ +! { dg-do compile } +! +! PR fortran/58803 +! +! Contributed by Vittorio Zecca +! +! Was before ICEing due to a double free +! + type t + procedure(real), pointer, nopass :: f1, f2 + end type + end |