This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/30720] runtime: check for empty array slices before allocating a negative amount of memory



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2007-02-06 21:00 -------
The wrong-code bug happens in gfc_trans_create_temp_array. For some reason, the
function argument to that function is false, and the code present to take care
of negative extent is not triggered. Thomas, you're the one who introduced this
argument:

2006-06-15  Thomas Koenig <Thomas.Koenig@online.de>

        * trans-array.h (gfc_trans_create_temp_array):  Add bool
        argument.
        * trans-arrray.c (gfc_trans_create_temp_array): Add extra
        argument "function" to show if we are translating a function.
        If we are translating a function, perform checks whether
        the size along any argument is negative.  In that case,
        allocate size 0.

do you remember why always performing that check (ie, turn function to be
always true) is not the right thing to do?


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30720


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]