summaryrefslogtreecommitdiff
path: root/libgfortran/m4/eoshift3.m4
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/m4/eoshift3.m4')
-rw-r--r--libgfortran/m4/eoshift3.m46
1 files changed, 2 insertions, 4 deletions
diff --git a/libgfortran/m4/eoshift3.m4 b/libgfortran/m4/eoshift3.m4
index 6fa3bd2f7dc..1c19575ffb8 100644
--- a/libgfortran/m4/eoshift3.m4
+++ b/libgfortran/m4/eoshift3.m4
@@ -108,10 +108,8 @@ eoshift3 (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))