diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2008-01-28 19:02:47 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2008-01-28 19:02:47 +0000 |
commit | bc81405676677a2216476eaebc34d23adf855f83 (patch) | |
tree | f3defc970bf3f58cf76fd6a1f8460b336a94a3f8 /libgfortran | |
parent | 2aa42e6e3bc7853d53a8231664a6efb0e87f944e (diff) | |
download | gcc-bc81405676677a2216476eaebc34d23adf855f83.zip gcc-bc81405676677a2216476eaebc34d23adf855f83.tar.gz gcc-bc81405676677a2216476eaebc34d23adf855f83.tar.bz2 |
re PR libfortran/34980 (Segfault in shape given a scalar)
2008-01-27 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/34980
* m4/shape.m4: If return array is empty, return early.
* generated/shape_i4.c: Regenerated.
* generated/shape_i8.c: Regenerated.
* generated/shape_i16.c: Regenerated.
From-SVN: r131915
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 8 | ||||
-rw-r--r-- | libgfortran/generated/shape_i16.c | 3 | ||||
-rw-r--r-- | libgfortran/generated/shape_i4.c | 3 | ||||
-rw-r--r-- | libgfortran/generated/shape_i8.c | 3 | ||||
-rw-r--r-- | libgfortran/m4/shape.m4 | 3 |
5 files changed, 20 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index a83ee24..b71eb30 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,11 @@ +2008-01-27 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR libfortran/34980 + * m4/shape.m4: If return array is empty, return early. + * generated/shape_i4.c: Regenerated. + * generated/shape_i8.c: Regenerated. + * generated/shape_i16.c: Regenerated. + 2008-01-26 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfofortran/34887 diff --git a/libgfortran/generated/shape_i16.c b/libgfortran/generated/shape_i16.c index a89c70a..77274d6 100644 --- a/libgfortran/generated/shape_i16.c +++ b/libgfortran/generated/shape_i16.c @@ -48,6 +48,9 @@ shape_16 (gfc_array_i16 * const restrict ret, stride = ret->dim[0].stride; + if (ret->dim[0].ubound < ret->dim[0].lbound) + return; + for (n = 0; n < GFC_DESCRIPTOR_RANK (array); n++) { ret->data[n * stride] = diff --git a/libgfortran/generated/shape_i4.c b/libgfortran/generated/shape_i4.c index 4f6d62e..787ba54 100644 --- a/libgfortran/generated/shape_i4.c +++ b/libgfortran/generated/shape_i4.c @@ -48,6 +48,9 @@ shape_4 (gfc_array_i4 * const restrict ret, stride = ret->dim[0].stride; + if (ret->dim[0].ubound < ret->dim[0].lbound) + return; + for (n = 0; n < GFC_DESCRIPTOR_RANK (array); n++) { ret->data[n * stride] = diff --git a/libgfortran/generated/shape_i8.c b/libgfortran/generated/shape_i8.c index a4a0ff0..f318b17 100644 --- a/libgfortran/generated/shape_i8.c +++ b/libgfortran/generated/shape_i8.c @@ -48,6 +48,9 @@ shape_8 (gfc_array_i8 * const restrict ret, stride = ret->dim[0].stride; + if (ret->dim[0].ubound < ret->dim[0].lbound) + return; + for (n = 0; n < GFC_DESCRIPTOR_RANK (array); n++) { ret->data[n * stride] = diff --git a/libgfortran/m4/shape.m4 b/libgfortran/m4/shape.m4 index f9dbcf7..3bda0ad 100644 --- a/libgfortran/m4/shape.m4 +++ b/libgfortran/m4/shape.m4 @@ -49,6 +49,9 @@ shape_'rtype_kind` ('rtype` * const restrict ret, stride = ret->dim[0].stride; + if (ret->dim[0].ubound < ret->dim[0].lbound) + return; + for (n = 0; n < GFC_DESCRIPTOR_RANK (array); n++) { ret->data[n * stride] = |