* [PATCH] toplev.c: set FILE * globals to NULL after fclose
@ 2016-08-10 0:56 David Malcolm
2016-08-10 10:15 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: David Malcolm @ 2016-08-10 0:56 UTC (permalink / raw)
To: gcc-patches; +Cc: David Malcolm
Successfully bootstrapped®rtested on x86_64-pc-linux-gnu.
OK for trunk?
gcc/ChangeLog:
* toplev.c (finalize): Set aux_info_file, asm_out_file, and
stack_usage_file to NULL after fclose calls.
---
gcc/toplev.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gcc/toplev.c b/gcc/toplev.c
index b0bb3ec..ddaee8a 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1894,6 +1894,7 @@ finalize (bool no_backend)
if (flag_gen_aux_info)
{
fclose (aux_info_file);
+ aux_info_file = NULL;
if (seen_error ())
unlink (aux_info_file_name);
}
@@ -1908,10 +1909,14 @@ finalize (bool no_backend)
fatal_error (input_location, "error writing to %s: %m", asm_file_name);
if (fclose (asm_out_file) != 0)
fatal_error (input_location, "error closing %s: %m", asm_file_name);
+ asm_out_file = NULL;
}
if (stack_usage_file)
- fclose (stack_usage_file);
+ {
+ fclose (stack_usage_file);
+ stack_usage_file = NULL;
+ }
if (!no_backend)
{
--
1.8.5.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] toplev.c: set FILE * globals to NULL after fclose
2016-08-10 0:56 [PATCH] toplev.c: set FILE * globals to NULL after fclose David Malcolm
@ 2016-08-10 10:15 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2016-08-10 10:15 UTC (permalink / raw)
To: David Malcolm; +Cc: GCC Patches
On Wed, Aug 10, 2016 at 3:25 AM, David Malcolm <dmalcolm@redhat.com> wrote:
> Successfully bootstrapped®rtested on x86_64-pc-linux-gnu.
>
> OK for trunk?
Ok.
Richard.
> gcc/ChangeLog:
> * toplev.c (finalize): Set aux_info_file, asm_out_file, and
> stack_usage_file to NULL after fclose calls.
> ---
> gcc/toplev.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/toplev.c b/gcc/toplev.c
> index b0bb3ec..ddaee8a 100644
> --- a/gcc/toplev.c
> +++ b/gcc/toplev.c
> @@ -1894,6 +1894,7 @@ finalize (bool no_backend)
> if (flag_gen_aux_info)
> {
> fclose (aux_info_file);
> + aux_info_file = NULL;
> if (seen_error ())
> unlink (aux_info_file_name);
> }
> @@ -1908,10 +1909,14 @@ finalize (bool no_backend)
> fatal_error (input_location, "error writing to %s: %m", asm_file_name);
> if (fclose (asm_out_file) != 0)
> fatal_error (input_location, "error closing %s: %m", asm_file_name);
> + asm_out_file = NULL;
> }
>
> if (stack_usage_file)
> - fclose (stack_usage_file);
> + {
> + fclose (stack_usage_file);
> + stack_usage_file = NULL;
> + }
>
> if (!no_backend)
> {
> --
> 1.8.5.3
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-10 10:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-10 0:56 [PATCH] toplev.c: set FILE * globals to NULL after fclose David Malcolm
2016-08-10 10:15 ` Richard Biener
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).