[Patch, Fortran] PR60576 Fix out-of-bounds problem

Tobias Burnus burnus@net-b.de
Tue Mar 25 00:07:00 GMT 2014


This patch fixes part of the problems of the PR. The problem is that one 
assigns an array descriptor to an assumed-rank array descriptor. The 
latter has for BT_CLASS the size of max_dim (reason: we have first the 
"data" array and than "vtab"). With "true", one takes the TREE_TYPE from 
the LHS (i.e. the assumed-rank variable) and as the type determines how 
many bytes the range assignment copies, one reads max_dimension elements 
from the RHS array - which can be too much.

Testcase: Already in the testsuite, even if it only fails under special 
conditions.

Build and regtested on x86-64-gnu-linux.
OK for the trunk and 4.8?

Tobias

PS: I haven't investigated the issues Jakub is seeing. With valgrind, 
they do not pop up and my attempt to build with all checking enabled, 
failed with configure or compile errors.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: assumed-rank.diff
Type: text/x-patch
Size: 832 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140325/373f4c78/attachment.bin>


More information about the Gcc-patches mailing list