OSDN Git Service

2011-07-05 Thomas Koenig <tkoenig@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / libgfortran / generated / pack_i8.c
index e49d8c2..7307192 100644 (file)
@@ -166,14 +166,12 @@ pack_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array,
          GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
 
          ret->offset = 0;
+
+         /* internal_malloc_size allocates a single byte for zero size.  */
+         ret->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * total);
+
          if (total == 0)
-           {
-             /* In this case, nothing remains to be done.  */
-             ret->data = internal_malloc_size (1);
-             return;
-           }
-         else
-           ret->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * total);
+           return;
        }
       else 
        {