[vta, trunk] don't leak uninitialized stack state into output
Richard Guenther
richard.guenther@gmail.com
Sun Mar 1 10:42:00 GMT 2009
On Sun, Mar 1, 2009 at 7:17 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
> When building certain initializers, the Fortran front-end allocates a
> buffer on the stack, sets up some elements of it from the source of the
> initialization, and then proceeds to use the entire buffer to initialize
> a larger destination. The result is that the uninitialized portion of
> the buffer leaks into the program output.
>
> I figured zero-initializing the entire buffer would often be pointless,
> so I decided to initialize only the portion that wasn't covered by the
> source.
>
> I'm pretty sure this was caught in a testsuite run with -fcompare-debug,
> but I don't recall the exact testcase :-(
>
> I'm installing this in the branch. Ok for trunk?
I think zeroing the buffer completely before using it would match
general programming style more appropriately (there's no
XCALLOCA, but maybe using xcalloc/free would be more appropriate
anyway in case that buffer can get large).
Of course I cannot approve the patch anyway.
Richard.
>
> --
> Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
> You must be the change you wish to see in the world. -- Gandhi
> Be Free! -- http://FSFLA.org/ FSF Latin America board member
> Free Software Evangelist Red Hat Brazil Compiler Engineer
>
>
More information about the Gcc-patches
mailing list