simplify.c (gfc_simplify_transfer): Zero-initialize the buffer.

* simplify.c (gfc_simplify_transfer): Zero-initialize the
buffer.

From-SVN: r144663
This commit is contained in:
Alexandre Oliva 2009-03-06 09:06:51 +00:00 committed by Alexandre Oliva
parent 8ae5dff133
commit 47ed69db7e
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2009-03-06 Alexandre Oliva <aoliva@redhat.com>
* simplify.c (gfc_simplify_transfer): Zero-initialize the
buffer.
2009-02-27 Tobias Burnus <burnus@net-b.de>
PR fortran/39309

View File

@ -4541,6 +4541,7 @@ gfc_simplify_transfer (gfc_expr *source, gfc_expr *mold, gfc_expr *size)
/* Allocate the buffer to store the binary version of the source. */
buffer_size = MAX (source_size, result_size);
buffer = (unsigned char*)alloca (buffer_size);
memset (buffer, 0, buffer_size);
/* Now write source to the buffer. */
gfc_target_encode_expr (source, buffer, buffer_size);