[Patch, libgfortran] PR 40330 Fix use of saved format strings

Janne Blomqvist blomqvist.janne@gmail.com
Wed Jun 3 19:18:00 GMT 2009


On Wed, Jun 3, 2009 at 22:00, Janne Blomqvist <blomqvist.janne@gmail.com> wrote:
> Hi,
>
> the attached patch fixes PR 40330. The problem was that for the saved
> format strings we were just keeping pointer to the strings that reside
> in the st_parameter_dt structure. However, this lives on the stack so
> once it goes out of scope the cached entries became invalid. Fixed by
> using heap storage.
>
> Regtested on x86_64-unknown-linux-gnu, Ok for trunk and 4.4?

Upon some further though, realloc() is not appropriate here.
Simplified patch attached.

Regtested on x86_64-unknown-linux-gnu, Ok for trunk and 4.4?


-- 
Janne Blomqvist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ChangeLog.2
Type: application/octet-stream
Size: 204 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20090603/82d31468/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr40330-ioregression-2.diff
Type: text/x-patch
Size: 1211 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20090603/82d31468/attachment.bin>


More information about the Fortran mailing list