This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30720] runtime: check for empty array slices before allocating a negative amount of memory
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Feb 2007 21:00:44 -0000
- Subject: [Bug fortran/30720] runtime: check for empty array slices before allocating a negative amount of memory
- References: <bug-30720-13648@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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