* [Patch, libgfortran] PR68987 [5/6 Regression] double free or corruption in _gfortran_st_write_done
@ 2015-12-26 21:56 Jerry DeLisle
2015-12-27 16:59 ` Thomas Koenig
0 siblings, 1 reply; 3+ messages in thread
From: Jerry DeLisle @ 2015-12-26 21:56 UTC (permalink / raw)
To: gfortran; +Cc: gcc patches
[-- Attachment #1: Type: text/plain, Size: 358 bytes --]
Attached patch eliminate this problem by reverting a portion of the previous
patch to pr65089.
Regression tested on x86_64-Linux. I will add test case from the PR.
OK for trunk and then back port to 5x?
Regards,
Jerry
2015-12-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/68987
io/format.c (format_error): Remove unneeded memory cleanup.
[-- Attachment #2: pr68987.diff --]
[-- Type: text/x-patch, Size: 860 bytes --]
diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c
index 2068af7e..fc7785e1 100644
--- a/libgfortran/io/format.c
+++ b/libgfortran/io/format.c
@@ -1180,26 +1180,6 @@ format_error (st_parameter_dt *dtp, const fnode *f, const char *message)
*p++ = '^';
*p = '\0';
- /* Cleanup any left over memory allocations before calling generate
- error. */
- if (is_internal_unit (dtp))
- {
- if (dtp->format != NULL)
- {
- free (dtp->format);
- dtp->format = NULL;
- }
-
- /* Leave these alone if IOSTAT was given because execution will
- return from generate error in those cases. */
- if (!(dtp->common.flags & IOPARM_HAS_IOSTAT))
- {
- free (dtp->u.p.fmt);
- free_format_hash_table (dtp->u.p.current_unit);
- free_internal_unit (dtp);
- }
- }
-
generate_error (&dtp->common, LIBERROR_FORMAT, buffer);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch, libgfortran] PR68987 [5/6 Regression] double free or corruption in _gfortran_st_write_done
2015-12-26 21:56 [Patch, libgfortran] PR68987 [5/6 Regression] double free or corruption in _gfortran_st_write_done Jerry DeLisle
@ 2015-12-27 16:59 ` Thomas Koenig
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Koenig @ 2015-12-27 16:59 UTC (permalink / raw)
To: Jerry DeLisle, gfortran; +Cc: gcc patches
Hi Jerry,
> Attached patch eliminate this problem by reverting a portion of the previous
> patch to pr65089.
>
> Regression tested on x86_64-Linux. I will add test case from the PR.
>
> OK for trunk and then back port to 5x?
Both.
Thanks a lot for the patch!
Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch, libgfortran] PR68987 [5/6 Regression] double free or corruption in _gfortran_st_write_done
@ 2015-12-27 17:20 Dominique d'Humières
0 siblings, 0 replies; 3+ messages in thread
From: Dominique d'Humières @ 2015-12-27 17:20 UTC (permalink / raw)
To: jvdelisle; +Cc: fortran, gcc-patches
Jerry,
Do you remember why you have added the block you want to delete?
Is there a way to do a test similar to if (!(dtp->common.flags & IOPARM_HAS_IOSTAT)) when using ERR?
Thanks for the patch.
Dominique
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-12-27 17:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-26 21:56 [Patch, libgfortran] PR68987 [5/6 Regression] double free or corruption in _gfortran_st_write_done Jerry DeLisle
2015-12-27 16:59 ` Thomas Koenig
2015-12-27 17:20 Dominique d'Humières
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).