aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/generated/eoshift1_16.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/generated/eoshift1_16.c')
-rw-r--r--libgfortran/generated/eoshift1_16.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libgfortran/generated/eoshift1_16.c b/libgfortran/generated/eoshift1_16.c
index a14bd292715..eb3a27a1c64 100644
--- a/libgfortran/generated/eoshift1_16.c
+++ b/libgfortran/generated/eoshift1_16.c
@@ -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))