diff options
Diffstat (limited to 'libgfortran/m4/reshape.m4')
-rw-r--r-- | libgfortran/m4/reshape.m4 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libgfortran/m4/reshape.m4 b/libgfortran/m4/reshape.m4 index 943f3e93653..6341b6e9a2c 100644 --- a/libgfortran/m4/reshape.m4 +++ b/libgfortran/m4/reshape.m4 @@ -115,11 +115,11 @@ reshape_'rtype_ccode` ('rtype` * const restrict ret, ret->offset = 0; if (unlikely (rs < 1)) - alloc_size = 1; + alloc_size = 0; else - alloc_size = rs * sizeof ('rtype_name`); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof ('rtype_name`)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } |