aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libgfortran/m4/reshape.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/libgfortran/m4/reshape.m4')
-rw-r--r--gcc-4.9/libgfortran/m4/reshape.m46
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc-4.9/libgfortran/m4/reshape.m4 b/gcc-4.9/libgfortran/m4/reshape.m4
index 943f3e936..6341b6e9a 100644
--- a/gcc-4.9/libgfortran/m4/reshape.m4
+++ b/gcc-4.9/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;
}