OSDN Git Service

2011-07-05 Thomas Koenig <tkoenig@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / libgfortran / generated / eoshift1_8.c
index 3e9162d..5f026ac 100644 (file)
@@ -88,7 +88,6 @@ eoshift1 (gfc_array_char * const restrict ret,
     {
       int i;
 
-      ret->data = internal_malloc_size (size * arraysize);
       ret->offset = 0;
       ret->dtype = array->dtype;
       for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
@@ -106,10 +105,8 @@ eoshift1 (gfc_array_char * const restrict ret,
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
         }
-      if (arraysize > 0)
-       ret->data = internal_malloc_size (size * arraysize);
-      else
-       ret->data = internal_malloc_size (1);
+      /* internal_malloc_size allocates a single byte for zero size.  */
+      ret->data = internal_malloc_size (size * arraysize);
 
     }
   else if (unlikely (compile_options.bounds_check))