aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/generated/pack_c16.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/generated/pack_c16.c')
-rw-r--r--libgfortran/generated/pack_c16.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libgfortran/generated/pack_c16.c b/libgfortran/generated/pack_c16.c
index 9397262dd06..e98de98c91c 100644
--- a/libgfortran/generated/pack_c16.c
+++ b/libgfortran/generated/pack_c16.c
@@ -166,14 +166,12 @@ pack_c16 (gfc_array_c16 *ret, const gfc_array_c16 *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_COMPLEX_16) * 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_COMPLEX_16) * total);
+ return;
}
else
{