This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran,patch] Fix zero-length substrings
- From: tobias dot schlueter at physik dot uni-muenchen dot de
- To: FX Coudert <fxcoudert at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, patch patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 8 Jun 2006 23:22:05 +0200
- Subject: Re: [gfortran,patch] Fix zero-length substrings
- References: <34484EB1-8E26-4730-8ABA-1DE0D7506119@gmail.com>
FX Coudert <fxcoudert@gmail.com> wrote on Thu, 08 Jun 2006:
The patch sets substring length to zero if it is computed (from the
start and end bounds) to be negative, fixing all these problems. I
also added a check to avoid calls to _gfortran_copy_string when the
destination length is zero, for example: d(5:4) = "foobar".
Using MAX_EXPR would be even simpler.
Regtested on i686-linux, it comes with a testcase that failed in
various places before the patch. OK for mainline and 4.1?
Ok, with the change to MAX_EXPR if you like.
- Tobi
:REVIEWMAIL:
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.