OSDN Git Service

2005-04-30 Thomas Koenig <Thomas.Koenig@online.de>
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 30 Apr 2005 20:51:39 +0000 (20:51 +0000)
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 30 Apr 2005 20:51:39 +0000 (20:51 +0000)
        PR libfortran/18958
        libgfortran.h:  Change typedef of index_type from size_t
        to ssize_t.

2005-04-30  Thomas Koenig  <Thomas.Koenig@online.de>

        PR libfortran/18958
        * gfortran.dg/eoshift.f90:  New test case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99047 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/eoshift.f90 [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/libgfortran.h

index 745c92c..00edc96 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-30  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/18958
+       * gfortran.dg/eoshift.f90:  New test case.
+
 2005-04-30  Paul Thomas  <pault@gcc.gnu.org>
 
        PR libfortran/18857
diff --git a/gcc/testsuite/gfortran.dg/eoshift.f90 b/gcc/testsuite/gfortran.dg/eoshift.f90
new file mode 100644 (file)
index 0000000..bb1cba4
--- /dev/null
@@ -0,0 +1,6 @@
+! { dg-do run }
+! PR 18958:  We used to segfault for eoshifting off the end of an array.
+program main
+  character(len=20) line
+  write (line,'(I4)') eoshift((/1, 3/), 3)
+end program main
index 64a3204..fe1ebfe 100644 (file)
@@ -1,3 +1,9 @@
+2005-04-30  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/18958
+       libgfortran.h:  Change typedef of index_type from size_t
+       to ssize_t.
+
 2005-04-30  Paul Thomas  <pault@gcc.gnu.org>
 
        PR libfortran/18857
index 7dd6993..c525fad 100644 (file)
@@ -215,7 +215,7 @@ typedef complex double GFC_COMPLEX_8;
 /* The following two definitions must be consistent with the types used
    by the compiler.  */
 /* The type used of array indices, amongst other things.  */
-typedef size_t index_type;
+typedef ssize_t index_type;
 /* The type used for the lengths of character variables.  */
 typedef GFC_INTEGER_4 gfc_charlen_type;