diff options
author | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-08-10 13:08:13 +0000 |
---|---|---|
committer | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-08-10 13:08:13 +0000 |
commit | 3a749c27ebf50edfc0be5294d96d76bf5a3f776c (patch) | |
tree | 6fba9baba5669dab3d554c58cd986fa8e0711087 | |
parent | 5186407c975ccaf3cc5d035a63fde9e007ab8adf (diff) | |
download | gcc-3a749c27ebf50edfc0be5294d96d76bf5a3f776c.tar.gz |
toplev.c: set FILE * globals to NULL after fclose
gcc/ChangeLog:
* toplev.c (finalize): Set aux_info_file, asm_out_file, and
stack_usage_file to NULL after fclose calls.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239322 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/toplev.c | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 17fa9faa002..cc23c1559b6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-08-10 David Malcolm <dmalcolm@redhat.com> + + * toplev.c (finalize): Set aux_info_file, asm_out_file, and + stack_usage_file to NULL after fclose calls. + 2016-08-10 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> PR target/71873 diff --git a/gcc/toplev.c b/gcc/toplev.c index b0bb3ecd309..ddaee8a55c1 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) { |