diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2017-11-04 09:07:09 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2017-11-04 09:07:09 +0000 |
commit | 77dacf9da6fe475efc87d63d7ea6fde66f097afc (patch) | |
tree | 9cfc4eb9f5646646c65966c675409c8089598d49 /gcc/fortran | |
parent | 9cfdd48417dce7d29a410510d2fb0e9b74b66878 (diff) | |
download | gcc-77dacf9da6fe475efc87d63d7ea6fde66f097afc.zip gcc-77dacf9da6fe475efc87d63d7ea6fde66f097afc.tar.gz gcc-77dacf9da6fe475efc87d63d7ea6fde66f097afc.tar.bz2 |
re PR fortran/81735 (double free or corruption (fasttop) error (SIGABRT) with character(:) and custom return type with allocatable)
2017-11-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/81735
* trans-decl.c (gfc_trans_deferred_vars): Do a better job of a
case where 'tmp' was used unititialized and remove TODO.
2017-11-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/81735
* gfortran.dg/pr81735.f90: New test.
From-SVN: r254404
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 9 |
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f653267..aa43ff4 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2017-11-04 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/81735 + * trans-decl.c (gfc_trans_deferred_vars): Do a better job of a + case where 'tmp' was used unititialized and remove TODO. + 2017-11-03 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/82796 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index c21611c..45d5119 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -4584,7 +4584,10 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block) && sym->ts.u.cl->passed_length) tmp = gfc_null_and_pass_deferred_len (sym, &init, &loc); else - gfc_restore_backend_locus (&loc); + { + gfc_restore_backend_locus (&loc); + tmp = NULL_TREE; + } /* Deallocate when leaving the scope. Nullifying is not needed. */ @@ -4636,10 +4639,6 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block) } gfc_add_init_cleanup (block, gfc_finish_block (&init), tmp); - /* TODO find out why this is necessary to stop double calls to - free. Somebody is reusing the expression in 'tmp' because - it is being used unititialized. */ - tmp = NULL_TREE; } } else if (sym->ts.type == BT_CHARACTER && sym->ts.deferred) |