re PR libfortran/17164 (index function not working properly)
2004-08-24 Bud Davis <bdavis9659@comcast.net> PR fortran/17164 * runtime/string_intrinsics.c (string_index):check for substring longer than string. * gfortran.dg/pr17164.f90: New test. From-SVN: r86527
This commit is contained in:
parent
1e19ac749d
commit
02d735f6bd
@ -1,3 +1,8 @@
|
||||
2004-08-24 Bud Davis <bdavis9659@comcast.net>
|
||||
|
||||
PR fortran/17164
|
||||
* gfortran.dg/pr17164.f90: New test.
|
||||
|
||||
2004-08-24 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
|
||||
|
||||
* gcc.dg/tree-ssa/loop-1.c: New test.
|
||||
|
10
gcc/testsuite/gfortran.dg/pr17164.f90
Normal file
10
gcc/testsuite/gfortran.dg/pr17164.f90
Normal file
@ -0,0 +1,10 @@
|
||||
! pr17164
|
||||
! index aborts when substring is longer than string
|
||||
implicit none
|
||||
character*5 x
|
||||
integer i
|
||||
x='12345'
|
||||
i=index(x,'blablabl')
|
||||
if (i.ne.0) call abort
|
||||
end
|
||||
|
@ -1,3 +1,9 @@
|
||||
2004-08-24 Bud Davis <bdavis9659@comcast.net>
|
||||
|
||||
PR fortran/17164
|
||||
* runtime/string_intrinsics.c (string_index):check for
|
||||
substring longer than string.
|
||||
|
||||
2004-08-24 David Edelsohn <edelsohn@gnu.org>
|
||||
|
||||
* Makefile.am (libgfortran_la_LDFLAGS): Add -lm.
|
||||
|
@ -221,6 +221,9 @@ string_index (GFC_INTEGER_4 slen, const char * str, GFC_INTEGER_4 sslen,
|
||||
if (sslen == 0)
|
||||
return 1;
|
||||
|
||||
if (sslen > slen)
|
||||
return 0;
|
||||
|
||||
if (!back)
|
||||
{
|
||||
last = slen + 1 - sslen;
|
||||
|
Loading…
Reference in New Issue
Block a user